|
From the system administration Script Guide Script Repository (http://www.microsoft.com/downloads/release.asp?ReleaseID=38942)
Stop a Service and Its Dependents Description Script Code strComputer = "."Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")Set colServiceList = objWMIService.ExecQuery("Associators of " _ & "{Win32_Service.Name='NetDDE'} Where " _ & "AssocClass=Win32_DependentService " & "Role=Antecedent" )For each objService in colServiceList objService.StopService()NextWscript.Sleep 20000Set colServiceList = objWMIService.ExecQuery _ ("Select * from Win32_Service where Name='NetDDE'")For each objService in colServiceList errReturn = objService.StopService()Next
|
RE: [ActiveDir] OT: How to schedule a service to stop and restart?
Jones, Rick J.(Desktop Engineering) Fri, 11 Oct 2002 09:38:40 -0700
- [ActiveDir] OT: How to schedule a ser... Kevin Felker
- RE: [ActiveDir] OT: How to sched... Jones, Rick J.(Desktop Engineering)
- RE: [ActiveDir] OT: How to sched... Salandra, Justin A.
- RE: [ActiveDir] OT: How to sched... Craig Cerino
- RE: [ActiveDir] OT: How to sched... Salandra, Justin A.
- RE: [ActiveDir] OT: How to sched... Kevin Felker
- RE: [ActiveDir] OT: How to sched... Salandra, Justin A.
- RE: [ActiveDir] OT: How to sched... Puckett, Richard
- RE: [ActiveDir] OT: How to sched... Craig Cerino
- RE: [ActiveDir] OT: How to sched... Roger Seielstad
- RE: [ActiveDir] OT: How to sched... Ken Cornetet
