Powershell: get-cmcollection not returning ObjectPath
The PowerShell cmdlets Get-CMCollection and Get-CMDeviceCollection/Get-CMUserCollection) returns an empty value for "ObjectPath".
This is missing in both 1710 and latest TP (currenty 1801).
This works as expected and ObjectPath = "/":
Get-WmiObject -namespace "root\sms\site_$siteCode" -query "select * from SMS_Collection where CollectionID = 'SMS00001'"
This returns null/empty ObjectPath:
Get-CMCollection -Id SMS00001
This appears to be a bug in the SMS Provider. I’ll file this internally.
You can work around it in the short term by using Invoke-CMWmiQuery to run a query and add -Option Fast.
Tnx Adam for the update, already worked around it for my current needs, just wanted to report it :)