如何找到针对使用 Powershell 使用模板创建的 Windows 服务监视器的组的名称?
我的意思是,我使用模板在 scom 中创建了一个监视器,我正在检查一项服务。我将监视器定位到一个组。我想用 Powershell 查找组名。
我想获取有关 Windows 服务模板的目标信息。如何使用 Powershell 获得此功能?
如何找到针对使用 Powershell 使用模板创建的 Windows 服务监视器的组的名称?
我的意思是,我使用模板在 scom 中创建了一个监视器,我正在检查一项服务。我将监视器定位到一个组。我想用 Powershell 查找组名。
我想获取有关 Windows 服务模板的目标信息。如何使用 Powershell 获得此功能?
要检索 'All Windows Computers' 的目标 ID,请执行$targetID = Get-SCOMClassInstance -Class (Get-SCClass | Where-Object DisplayName -Like 'All Windows Computers') | Select ManagementPackClassIds
.
然后使用目标ID查询'Get-SCOMMonitor | 选择对象-First 1 | where-object DisplayName -eq '高取值查询' | where-object Target -like 'ManagementPackElementUniqueIdentifier=$targetID*'` 看看你得到了什么。这就是你可以做的事情。请注意,您可能必须执行一些字符串插值才能使其与 $targetID 一起使用。