A common task that a System Administrator might face in their day is restarting a service on a remote system. While this can be accomplish using the Services.MSC or another various GUI, you have to load the GUI, then connect to the remote system, locate the service and finally perform the action on the service.
There are a few ways that this can be done using WMI (Win32_Services) and using Get-Service along with Stop/Start/Restart-Service cmdlets.
The first method of managing a service that I will go into is using WMI to accomplish this task. First I will connect to the specific service that I want to manipulate, in this case, the windows update client service: wuauserv.
$service = Get-WmiObject -ComputerName DC1 -Class Win32_Service ` -Filter "Name='wuauserv'" $service
We now have our WMI service object for wuauserv. Lets take a look at all of the available methods for…
View original post 721 more words