markhallen
6/5/2017 - 12:28 PM

From https://social.technet.microsoft.com/Forums/systemcenter/en-US/d0fcf7c7-b787-441e-be52-2572d76d8c1a/querying-sccm-for-collection-rules-

Get-CMDeviceCollection | ? {$_.CollectionRules.RuleName -ne $null} | % {Get-CMDeviceCollectionQueryMembershipRule -CollectionID $_.CollectionID -RuleName $_.CollectionRules.RuleName}