Hi, I am trying to create a powershell script (script 1) set up on our Support Server to execute a Remote Script on a Remote Server (script 2) to Restart a service. Simple - The script works fine when i execute it manually but fails when I try and use Nagios to call the Script using NRPE.
Script 1 Contains (I have cut out all the Nagios inspired stuff)
invoke-command -computer ws05 -command { & 'C:\Program Files\NSClient++\scripts\script2.ps1' }
SendEmail
Script 2 Contains
Stop-Service spooler
Nagios is successfully executing Scrip 1 as I get the confirmation email
Nagios itself returns [ws05] Connecting to remote server failed with the following error message : Ac
I'm assuming its a Permission issue but cant see how it works when executed manually but not when Executed via Nagios. My Only thought is the fact that the original call is from Nagios which is a Linux based None Domain server.
Any Thoughts Appreciated
Carl