Listing management servers in the maintenance mode
It is always an important daily health check requirement to list all the management servers in the maintenance mode. The following code lists all the SCOM management servers in the maintenance mode. This code will simply print whether the management server is in the maintenance mode or not. We can alter it to make the output a part of any particular report:
$MSs = get-SCOMGroup -DisplayName "Operations Manager Management Servers" | Get-SCOMClassInstance foreach ($MS in $MSs) { if($MS.inMaintenanceMode -eq "False") { Write-Host $MS.DisplayName, "is not in Maintenance Mode" } Else { Write-Host $MS.DisplayName, "is in Maintenance Mode" } }