Windows Server 2012 R2 - error consistent with three other VMs but many other vms are working with the same script Remote RM enabled and able to ping the box from the PA Monitor Server $alert_output = ""
$Updates = ""
$UpdateSession = ""
$UpdateSearcher = ""
$Updatesresult = ""
$Count = ""
$Update = ""
$Title = ""
$KB = ""
$IsDownloaded = ""
$updatehistory = ""
$updatehistorycount = ""
$fwAlert = 0
$systename = $mon.ComputerName
$session = New-PSSession -ComputerName "$systename"
$sesoutput = $session.Availability
if($session.Availability -ne "Available")
{
$mon.FireActions = $true
$mon.Details = "Cannot connect"
}
else
{
$systenamecheck = Invoke-Command {
$systename = $env:computername
Return $systename
} -Session $session
$osversion = Invoke-Command {
$osversion = [System.Environment]::OSVersion.Version
Return $osversion
} -Session $session
} asked 12 Oct '21, 14:26 poweradminmj |
Hi poweradminmj, The error "Object reference not set to an instance" is a command error and most of the time it means that some variable or function’s return value is null. Please check your code to see if you can check for null. Another option to all this would be to use the Inventory Collector monitor. One of the features of this monitor is to get a count of Updates needing to be installed. You can then use the Inventory Alerter monitor to fire alerts based on the collectors data. Thanks Please make sure to mark your questions accepted when you have your answer by clicking the gray checkmark to the left of the answer. answered 12 Oct '21, 15:44 Quinn ♦♦ |