IIS 6.0, Getting Information Using WMI - How about SMTP, POP3, FTP services in IIS? (Page 5 of 5 )
Any IIS being used for production would generally have one or more of SMTP, POP3, or FTP services enabled. WMI can still help us retrieve information even to that level. The main information about the “status” of those services can be known using the classes “IISSmtpService”, “IISFtpService” and “IISPOP3Service” classes respectively. Let us consider a few more scripts with respect to those services.
Let us see if SMTP was enabled in IIS (using WMI). The following is the code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MicrosoftIISv2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM IIsSmtpService",,48)
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name & " -> running: " & objItem.Started
Next
Let us see if FTP was enabled in IIS (using WMI). The following is the code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MicrosoftIISv2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM IIsFtpService",,48)
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name & " -> running: " & objItem.Started
Next
Let us see if POP3 was enabled in IIS (using WMI). The following is the code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MicrosoftIISv2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM IIsPop3Service",,48)
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name & " -> running: " & objItem.Started
Next
And that is that.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |