I have a simple powershell monitor that simply validates against a hostname to ensure that a dns record exists. The monitor runs locally against solarwinds instance, and runs against 400 out of 403 machines. The three machines that are not running it against give me back:
Output: ==============================================
unable to run command against BDRCITRIX01
The term 'Clear-DnsClientCache' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
statistic: 1
not sure what the deal with that is since it runs against other machines just fine.
script is basically:
$computer = $args[0];
try {
Clear-DnsClientCache
Resolve-DnsName $computer -ErrorAction Stop
write-host "statistic: 0"
}
catch {
write-host "unable to run command against" $computer
write-host $_.Exception.Message
write-host "statistic: 1"
}