2009. 11. 13. 10:22
시작 상태가 Auto인데 중지된 상태인 서비스 쿼리 후 이벤트 찍기 - VB Script (VBS) Etc.2009. 11. 13. 10:22
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service")
For Each objService in colListOfServices
If (objService.StartMode = "Auto") and (objService.State = "Stopped") then
Set objShell = CreateObject("Wscript.Shell")
objShell.LogEvent 2, "Service " & objService.DisplayName & " is not running. (" & objService.Name & ")"
End If
Next
응용 프로그램 이벤트 로그