Version 1

    This script takes the service's short name as a second argument (first is the server) and stops all of the dependencies of the dependencies of the service, the dependencies and the service itself and then starts them up again.

    If you use this in an alarm on your Orion server you need to run the Solarwinds Alerting Engine service with a user that is allowed to execute the code on remote servers or give the local computer account access do execute the code on a remote machine.

    I started a lonely small discussion on that here:

    Restart Service on alarm

     

    Works fine for me but should there be a service that has dependencies on a service that has dependencies on a service that has dependencies on the selected service, this script will not work :P

    But I dont know of anything where that would apply, the code could be adjusted to accommodate this.

    Warning: The script works but it probably is not the most efficient code (I am not an experienced scripter) so use on your own risk :)