I've already contacted Solarwinds support and didn't get anywhere. I was referred from support to the forums, which seems a little backwords to me. Either way, here is my issue/question. Why would a remote schtasks request not work through APM, but a local one will. Specifying credentials doesn't help either. Any ideas or suggestions are welcome.
Non-working (requires {$IP} argument):
Dim WshShell,oExec
strPC = Wscript.Arguments(0)
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("schtasks /query /fo list /v /s " & strPC)
strHold = oExec.StdOut.ReadAll
strHold = Replace(strHold,Chr(10),"<br> ")
WScript.Echo "Message:" & strHold
WScript.Echo "Statistic:0"
WScript.Quit(SUCCESS)
Working:
Dim WshShell,oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("schtasks /query /fo list /v")
strHold = oExec.StdOut.ReadAll
strHold = Replace(strHold,Chr(10),"<br> ")
WScript.Echo "Message:" & strHold
WScript.Echo "Statistic:0"
WScript.Quit(SUCCESS)