question

knowlh-3434 avatar image
0 Votes"
knowlh-3434 asked RichMatheisen-8856 answered

Script to read large number of SCCM collection names from a csv and loop through to update collection membership

Looking for PS to read large number of collection names from a csv and update collection membership

windows-server-powershell
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Trying to write up with Get-CMDeviceCollection but not having success with member count update.
142976-cmdevicecollection.jpg


0 Votes 0 ·
RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered knowlh-3434 commented

What's a "collection name"? Update it with what, and from where?

What code have you written in your attempt to perform this task? Please post it.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

appreciate your help. updated my request

0 Votes 0 ·
RichMatheisen-8856 avatar image
0 Votes"
RichMatheisen-8856 answered

You'll have to much more specific.

 Import-Csv SomeFileName.csv |
     ForEach-Object{
         Get-CMDeviceCollection -Name $_.CollectionName
         # Okay . . . now what? Do something with LocalMemberCount????
     }
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.