' List IMAP Server State
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:{authenticationLevel=pktPrivacy}\\" _
& strComputer & "\root\microsoftiisv2")
Set colItems = objWMIService.ExecQuery("Select * from IIsImapServer")
For Each objItem in colItems
Wscript.Echo "IMAP Service Version: " & objItem.ImapServiceVersion
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Server State: " & objItem.ServerState
Next