I have to reset a sequence of services on a group of servers in a certain order. sc.exe
is asynchronous, it will return when the service is in the START_PENDING or STOP_PENDING state. Start-Service
/Stop-Service
will wait for the service to start or stop, but it only works on the local machine, and I don't have remoting enabled in my environment.
Is there an alternative exe or CmdLet to do this? Looks like I'm going to have to use the .NET API.