Add Systems to SCCM Collection from Text File

This PowerShell command will allow you to add a list of systems to a specified collection in SCCM.

Get-Content "C:\system_list_to_add.txt" | ForEach { Write-Output "Adding System: $_"; Add-CMDeviceCollectionDirectMembershipRule -CollectionName "Computer Add Collection" -ResourceID (Get-CMDevice -Name $_).ResourceID }

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.