Workflow: Remote Scripts

Workflow: Remote Scripts

I have a monitor watching a log file on an IIS server for a particular error. If the error is found I want it to trigger a workflow to restart an IIS App Pool. I have the monitor working fine. The issue seems to be running the remote windows script function in Workflow.

I want to use the PowerShell Command "Restart-WebAppPool <mypoolname>" but it seems to try to run from the OpManager server and not the remote host. Do I need to wrap the command in an Invoke-Command?

I am currently use the following...

Command Line:
cmd /c powershell.exe -ExecutionPolicy RemoteSigned .\${FileName}.ps1

Script Body:
Restart-WebAppPool MyPoolName

      New to ADSelfService Plus?


                Related Products