We had a requirement to start a service if its stopped and this script helps to achieve the same
==============
Const ADS_SERVICE_STOPPED = 1
' get an ADSI object for a computerSet objComputer = GetObject("WinNT://computer name,computer")
' get an object for a serviceSet objService = objComputer.GetObject("Service","alerter")
' check to see if the service is stopped
If (objService.Status = ADS_SERVICE_STOPPED) Then
' if the service is stopped, then start it
objService.Start
End If
==================
Wednesday, November 18, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment