Hi fellow Thwackers 
I'm sure this is a simple permissions question but I can't find the answer.
I'm trying to restart a service on a remote domain controller.
start-service (service name)
I've tried .bat and .ps1 but I keep getting error code 2.
If I try running the .ps1 script I get the execution policy restriction, if I run it manually and accept the popup it runs OK and starts the service.
So I need to either auto approve the execution policy popup or change the execution policy restrictions on the local machine. As it's a DC I'd prefer not to open it up like that.
Sorry, let's go back a little.
I have an alert that's checking a service is running on the DC, if it sees the service has stopped (Always happens after a server restart) I want to then execute a script that restarts the service for me from the alert. The alert is working fine and identifies if the service stops and starts. It's the second part of my process I'm having issues with starting the service again.
I've tried calling the script from the polling engine and locally but still get the error code 2.
I'm working to resolve this today (If I can) and will post back any findings or solutions as and when I find them, but in the meantime if anyone has a solution they have working I'm willing to accept any help available.
Thanks in advance