DougInCanada
Technical User
Is it possible to execute Net Stop and Net Start for services on a remote server using VB Script from another server?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
strComputer = "[red]RemoteServerNameOrIPAddress[/red]"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServiceList = objWMIService.ExecQuery _
("Select * from Win32_Service where Name='NetDDE'")
For Each objService in colServiceList
errReturn = objService.StopService()
Next
Wscript.Sleep 20000
For Each objService in colServiceList
errReturn = objService.StartService()
Next