Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20686

SAM Powershell monitor returns "Not Defined" as the output

$
0
0

I've seen several discussions dance around this issue; but, I can't seem to find the missing piece.  So ..... here goes:

 

I'm trying to set up a Powershell Monitor in SAM 6.1.1. I'm using good credentials tested via Powershell Console.  I've also configured WINRM per another support article.  I've set this up as a remote monitor run on the NPM server.

 

Here's the script:

 

Clear-Host

$MC3 = "hqmailcas3"

$DB1 = "hqmaildb1"

$rebootmc3 = 0

 

 

$BootedMC3 = Get-WmiObject -Class Win32_OperatingSystem -Computer $MC3

$MC3UP = $Booted.LastBootUpTime

 

 

$BootedDB1 = Get-WmiObject -Class Win32_OperatingSystem -Computer $DB1

$DB1UP = $BootedDB1.LastBootUpTime

 

 

if ($MC3UP -gt $DB1UP) {$rebootmc3 = 1}

 

 

Write-Host 'Statistic: ' $rebootmc3

 

 

exit ($rebootmc3)

 

Where am I going wrong?  I'm not getting an output for this.


Viewing all articles
Browse latest Browse all 20686

Trending Articles



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