Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Here is a code snippet which is used to verify the status of an Web Directory Application using WMI, without opening IIS Manager.
strComputer = "."
Set objWMIService = GetObject("winmgmts:{authenticationLevel=pktPrivacy}\\" & strComputer & "\root\microsoftiisv2")
Set colItems = objWMIService.ExecQuery("Select * From IIsWebDirectory Where Name = " & "'W3SVC/2142295254/root/aspnet_client_folder'")
For Each objItem in colItems
strStatus = objItem.AppGetStatus
If strStatus = 2 Then
Wscript.Echo "The application is running."
ElseIf strStatus = 3 Then
Wscript.Echo "The application is stopped."
Else
Wscript.Echo "The status could not be determined."
End If
Next
Supported Platform: Windows Server 2003
- Anonymous
November 15, 2007
PingBack from http://msdnrss.thecoderblogs.com/2007/11/16/verify-the-status-of-an-web-directory-application-using-wmi/