脚本有问题,尝试通过 powershell 脚本重新计算 SCOM 中的信息。重新计算时遇到问题。
#imput parameters
Param(
[Parameter(Mandatory=$False)]
[string[]]$computerName
)
Import-Module OperationsManager
#Main SCOM server var
$computerName = "SCOMserver"
#Connect to the SCOM-Mgmt Server
New-SCOMManagementGroupConnection -ComputerName $computerName
#Get all the SCOMalert filtered queue warning state
$alerts = Get-SCOMalert -ComputerName $computerName | Where-Object {$_.Owner -eq “user01” -and $_.ResolutionState -eq “0” -and $_.IsMonitorAlert -eq $true}
Foreach ($ActiveMonitor in $alerts)
{
$ActiveMonitor.recalculatemonitoringstate() | Test-SCOMMonitoringTaskResultForError
}
我得到的错误:方法调用失败,因为 [Microsoft.EnterpriseManagement.Monitoring.MonitoringAlert] 不包含名为“recalculatemonitoringstate”的方法。