+ Post New Thread
Results 1 to 6 of 6
Scripts Thread, Script request in Coding and Web Development; Hi guys I had a look around for a script format I could work off but didn't see any that ...
  1. #1

    Join Date
    Sep 2012
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Script request

    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

  2. #2

    X-13's Avatar
    Join Date
    Jan 2011
    Location
    /dev/null
    Posts
    9,245
    Thank Post
    607
    Thanked 2,023 Times in 1,392 Posts
    Blog Entries
    19
    Rep Power
    867
    Many options.


    Personally, I'd go for:

    Code:
    sc \\machine stop <service>
    sc \\machine start <service>

  3. Thanks to X-13 from:

    mac_shinobi (25th September 2012)

  4. #3

    Join Date
    Sep 2012
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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

  5. #4

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,068 Times in 625 Posts
    Rep Power
    740
    Just write a PS script which monitors the service which then re-starts it when it fails. Schedule it on the server. Problem solved.

  6. #5
    ADMaster's Avatar
    Join Date
    May 2012
    Posts
    339
    Thank Post
    5
    Thanked 36 Times in 31 Posts
    Rep Power
    24
    You could also set the service failure action to restart so the server will restart the service for you.

  7. #6

    Join Date
    Sep 2012
    Posts
    3
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 12
    Last Post: 8th August 2011, 05:15 PM
  2. Replies: 9
    Last Post: 17th July 2010, 07:52 AM
  3. Replies: 22
    Last Post: 15th June 2010, 08:16 AM
  4. Replies: 3
    Last Post: 25th September 2006, 12:27 PM
  5. Replies: 5
    Last Post: 5th March 2006, 01:22 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •