This Vbs script will prompt you for a remote or local machine name and set the Automatic Updates service start mode to Automatic and start the service if it is not running for ITMU use.
Vbs Script:
strComputer = InputBox("Enter Machine Name")
srtService = "Automatic Updates"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\Cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * from Win32_Service Where DisplayName ='" & srtService & "'")
For Each objItem in colItems
If objItem.State = "Running" Then
objItem.StopService()
End If
errRetCode = objItem.ChangeStartMode("Automatic")
objItem.StartService()
Next
MsgBox "The " & srtService & " on " & UCase(strComputer) & " Has Been Set To Automatic"
No Comments