Quantcast
Channel: THWACK: All Content - Server & Application Monitor
Viewing all articles
Browse latest Browse all 12281

SAM - Pending Reboot Monitor

$
0
0

Hello,

 

We've been facing an issue recently where servers maybe need 2+ reboots post patching which is being missed.  I've managed to create a SAM Powershell alert using the following code (should anyone else want it), however is there a cleaner, neater way to do this?

 

if ((Invoke-WmiMethod -ComputerName localhost -Namespace "ROOT\ccm\ClientSDK" -Class CCM_ClientUtilities -Name DetermineIfRebootPending  | select-object -ExpandProperty "RebootPending") -eq $true) {Write-Host "Message:Reboot Pending"; Write-Host "Statistic:1"} else {Write-Host "Message:No Reboot Pending"; Write-Host "Statistic:0"}

 

Thanks,

Peter


Viewing all articles
Browse latest Browse all 12281

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>