Start Services on Remote Computer

This script will start Automatic services on a remote server that have either failed to start or have stopped. It's specifically looking for Exchange 2010 services, but the code can be easily adjusted for any services. Assumes WS-MAN and PowerShell v2.

 
 
 
 
 
5 Star
(3)
Add to favorites
Operating System
3/17/2011
E-mail Twitter del.icio.us Digg Facebook
  • Multiple Services - Multiple Servers
    3 Posts | Last post December 07, 2011
    • Have you ever considered a script like this to stop multiple services across mulitple servers then restart them in a set order?  I have a commercial application that uses both SQL and other pieces (JBOSS and stuff) and if the systems do not reboot or are not available in the correct order than the system does not function properly.  Currently I need to remote into both boxes, stop services on one system, run a restart of the services on the second (in a specific order) than restart the services on the initial server.  If I could automate this process I could actually allow for specific process owners to restart these function.
    • Certainly this is possible. In fact, it's just an extension of what I'm doing with this script. You know the services you're interested in, and the order they need to be stopped and started in. It's pretty straightforward to simply do it. Create PSSessions for each computer involved, and connect to them in the necessary order. 
    • Hi Charlie Russel,
      I want to create the script to check the service Start or Stop every 30 seconds. If the service ClusSvc stop, the script will be force the service ClusSvc to start. if the ClusSvc start, the condition is exit. 
      
      Could you guide me?
      
      BR
      Khemarin