为什么我可以使用 获取 WMI 对象Get-CMBoundaryGroup
,但不能直接使用Get-WmiObject
?我Invalid namespace "root\sms\site_CAS"
使用时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"