1

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" 
David Klempfner
  • 195
  • 2
  • 13

1 Answers1

1

The code is working properly in my test lab.

Based on your error code, I recommend you use the WMI Explorer to review your namespace. https://wmie.codeplex.com/

enter image description here