Refresh SCCM Collection?


  • Hi,

    I'm checking for an sccm collection via Powershell, if it sees the device I added, but it looks like it stays in a loop for ages.

            $Collection = Get-CMDeviceCollection -Name $CollectionName 
            $null = Invoke-WmiMethod -Path "ROOT\SMS\Site_$($SiteCode):SMS_Collection.CollectionId='$($Collection.CollectionId)'"           Name RequestRefresh  -ComputerName $SCCMServer 

    Do this ...

    While(!(Get-CMDevice -CollectionName $CollectionName | Select Name | Where-Object {$_.Name -eq $vm}))

    Also  a refresh in the console takes 10 s of minutes. The collection is set on incremental updates but there are only 10 systems in the sccm collection. Imported the sccm object via:

    Import-CMComputerInformation -ComputerName $vm -MacAddress $Mac -CollectionName $CollectionName 

    Can see the vm in the collection membership rules (properties of collection) but (as mentioned) takes ages before it appears in the collection members.

    Please advise howto optimize or speedup this process.

    Jan Hoedt

    Friday, June 15, 2018 3:43 PM

All replies

  • What are you trying to achieve here outside of built in functionality?

    Are you sure that the device you expect to see is within the limiting collection first?

    Dan Padgett | Blog: | Twitter: @danjpadgett

    Saturday, June 16, 2018 1:35 PM
  • check the limited collection update properties, if it takes time to appear there then it will take more for the actual collection

    Cherif Benammar

    Sunday, June 17, 2018 9:35 AM