Hi all, I know, this has been already discussed - but I really cannot get it running even after reading everything I could find here.
I have "PSWindowsUpdate PowerShell Module" running on my servers, which is pretty handy to manage all WSUS tasks. And it can be easily used to e.g. check for pending reboots.
My powershell script seems to be running fine:
param( [string]$hostip = "default" ) $pendingboot = Get-WURebootStatus -ComputerName $hostip -silent $value = switch($pendingboot){"True" {1}; "False" {0}} if ($value -eq 1){ Write-Output "$($value):reboot pending" }else{ Write-Output "$($value):no reboot required" }
I can confirm valid output if I run it manually on PRTG Probe "PRTGSRV"
PS C:\Users\Administrator> Get-WURebootStatus -ComputerName SERVER01 -silent True PS C:\Users\Administrator> Get-WURebootStatus -ComputerName PRTGSRV -silent False
However, when I add the Custom EXE sensor to SERVER01, it will always report "false/no reboot required". Parameters are -hostip '%host'
SERVER01: srv2016 PRTGSRV_ srv2019 both have Powershell 5.1 and PSWindowsUpdate Module installed. PRTG Version is 23.1.82.2175+
Any Ideas, how to get this running?
Add comment