Quantcast
Channel: Operations Manager - General forum
Viewing all articles
Browse latest Browse all 11941

Specific line in PS script doesn't work from inside SCOM

$
0
0

hey all,
i wrote a short PS script, all it does is:

invoke-expression "C:\uri\Attachmate\RSecure\ssh2.exe -W C:\uri.txt uguy@iinf102 ls /snapshots" | Out-File C:\output2.txt
"hello from scom15" | Out-File C:\output3.txt

I added the 2nd line just for checking.
when I run it from PS CMD it runs fine and i get the outputs into the 2 text files, however when i configure it to run in response to an alert in SCOM (using a command channel) the first command fails to execute and the output2.txt file remains blank.

I have no idea why there's a difference between running from SCOM or from PS shell.
Any help will be really really appreciated.

thanks,
Uri



Viewing all articles
Browse latest Browse all 11941

Trending Articles



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