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" 
1
  • "invalid namespace". The namespace doesn't exist. – Bill_Stewart Feb 21 '17 at 17:12
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

1
  • The namespace is not available for me. Apparently I need to run it on my primary site server. – David Klempfner Feb 21 '17 at 3:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.