In a follow up to @ScriptingGuys post about restarting services using VBScript, here is the same using PowerShell. I’ll probably be dragging the same onto some server monitoring stuff to get a service back up and running we’ve been having a weird issue with1.
1 2 3 4 5 6 7 8 9
This takes a file “computers.txt”, loops through the data, and uses WMI to connect to the remote machines to get the wuauserv service (or in plain English Windows Automatic Update). Easy as pie.
Service has just been vanishing, no logs that it has stopped, crashed, or anything↩