Export Grey Agents using Powershell on System Center Operations Manager

Merhaba aşağıdaki powershell scriptini kullanarak Operations Manager yapınızda grey health durumda bulunan sunucularınızı kolayca tespit edebilir ve sorunlarınızı hızlıca inceleyebilirsiniz.

1

#Import the OperationsManager module

Import-Module OperationsManager

#Define the output file

$file=”C:\Temp\GreyAgents.txt”

#Get the agent class and the each object which is in a grey state

$agent = Get-SCClass -name “Microsoft.SystemCenter.Agent”

$objects = Get-SCOMMonitoringObject -class:$agent | where {$_.IsAvailable –eq $false}

#Export each objet into a file

ForEach ($object in $objects){$object.DisplayName+ “,”+ $object.HealthState | Out-File $file -Append}

Faydalı Olması Dileğiyle…

Reklamlar