Nynaeve Posted September 24, 2012 Posted September 24, 2012 Hi guys 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. Many thanks Nynaeve
X-13 Posted September 24, 2012 Posted September 24, 2012 Many options. Personally, I'd go for: sc \\machine stop sc \\machine start 1
Nynaeve Posted September 24, 2012 Author Posted September 24, 2012 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 Nynaeve
mattx Posted September 24, 2012 Posted September 24, 2012 Just write a PS script which monitors the service which then re-starts it when it fails. Schedule it on the server. Problem solved.
ADMaster Posted September 25, 2012 Posted September 25, 2012 You could also set the service failure action to restart so the server will restart the service for you.
Nynaeve Posted September 25, 2012 Author Posted September 25, 2012 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now