This means you need to lookup the Resource ID of the PC, which you can do by Name, before you dump it in.
ADD:
$x="PCNAME";$collectionname="
Collection
";Add-CMDeviceCollectionDirectMembershipRule -CollectionName $collectionname -ResourceId $(get-cmdevice -Name $x).ResourceID
Removal is Simpler, as you simply need to specify the PC name and Collection name.
REMOVE:
Remove-CMDeviceCollectionDirectMembershipRule -CollectionName <String> -ResourceName <String> [-Force]
No comments:
Post a Comment