kascecoffee.blogg.se

Valmod pack showing question marks
Valmod pack showing question marks






valmod pack showing question marks

GroupMaintMode -ScomServer "localhost" -GroupDisplayName "Maint Mode Network Group1" -DurationInMin 30 -Reason "ApplicationInstallation" -Comment "Suppress Alerting on network from PowerShell Custom Example script" #Usage (calling the GroupMaintMode function) Should probably alert on this conditionĬreateMyEvent 13 $sourceEvt "All Servers failed ping we need to set maint mode now to suppress alerting" "" $serverPing "" "" "" "" #log event indicating suppressing alerts. Write-Host "All Servers failed ping we need to set maint mode now to suppress alerting" -ForegroundColor Red GroupMaintModeStop -ScomServer "localhost" -GroupDisplayName "Maint Mode Network Group1" -DurationInMin 10 -Reason "ApplicationInstallation" -Comment "Suppress Alerting on network from PowerShell Custom Example script" #log event that removing alert suppressionĬreateMyEvent 11 $sourceEvt "Found Server that successfully pinged we need to stop maint mode now to Allow for alerting" "" $serverPing "" "" "" "" Write-Host "Found Server that successfully pinged we need to stop maint mode now to Allow for alerting" -ForegroundColor Green $Output = Get-Job | Receive-Job #| Out-GridView Comand, Name ArgumentList for all jobs that are pinging addresses in file this is threaded to improve speed If (!(test-path ` HKLM:\SYSTEM\CurrentControlSet\Services\Eventlog\Application\$sourceEvt )) (::Now).addminutes($DurationInMin).touniversaltime(), ` $group.ScheduleMaintenanceMode(::Now.touniversaltime(), ` New-SCOMManagementGroupConnection -ComputerName $ScomServerįorEach ($group in (Get-ScomGroup -DisplayName $GroupDisplayName)) #($ScomServer, $GroupDisplayName, $DurationInMin, $Reason, $Comment) $eventLogTest.WriteEvent($ei, to event log" "Writing Eid: " + $iEID + " with parameters" If servers respond then take group out of maintįunction CreateMyEvent ($iEID, $sourceEvent, $param1,$param2,$param3,$param4,$param5,$param6,$param7) #Example script ping servers on specific network from hardcoded list if all servers down then put servers in maint I wrote a PowerShell script that would ping the servers in a file and if all failed would set maintenance mode for a SCOM group of servers.īelow is the script contents. I had a customer request where they had relatively consistent errors with a give network and they wanted to suppress alerting when they had this issue arise.








Valmod pack showing question marks