why can I get a WMI object using Get-CMBoundaryGroup
, but not directly using Get-WmiObject
? I get Invalid namespace "root\sms\site_CAS"
when using Get-WmiObject
$boundaryGroup1 = Get-CMBoundaryGroup -Name 'BoundaryGroupName'
$class = $boundaryGroup1.ManagedObject.__CLASS #SMS_BoundaryGroup
$namespace = $boundaryGroup1.ManagedObject.__NAMESPACE #root\sms\site_CAS
$boundaryGroup2 = Get-WmiObject -Class $class -Namespace $namespace #Invalid namespace "root\sms\site_CAS"