I had a look around for a script format I could work off but didn't see any that actually worked.
I have a server side service that is a little bit tempermental and needs constant restarting. I was wondering if someone could let me know how to create a script to restart it from a workstation? Hopefully to avoid remoting into the server every time it needs restarting.
Personally, I'd go for:
sc \\machine stop <service>
sc \\machine start <service>
Pretty simple looking at that
So im looking at:
"sc \\192.168.1.5 stop iisadmin
sc \\192.168.1.5 start iisadmin"
Thanks for the help
Just write a PS script which monitors the service which then re-starts it when it fails. Schedule it on the server. Problem solved.
You could also set the service failure action to restart so the server will restart the service for you.
The problem is most of the time this service thinks its still running ok. So action on failure - restart service or run a program (iis reset script) does not kick in.