IIS
  Home arrow IIS arrow Page 5 - IIS 6.0, Getting Information Using WMI
Iron Speed
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
IIS

IIS 6.0, Getting Information Using WMI
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 31
    2005-10-12

    Table of Contents:
  • IIS 6.0, Getting Information Using WMI
  • What is new in IIS 6.0?
  • Can we retrieve IIS information using WMI?
  • Playing with Virtual directories and Web applications
  • How about SMTP, POP3, FTP services in IIS?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    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.

       · Hey guys, the power of WMI with IIS6 is here...have some good suggetions?...do not...
     

    IIS ARTICLES

    - Retrieving IIS information using ASP.NET 2.0
    - IIS 6.0, Getting Information Using WMI
    - The Importance of a Domain
    - Implementing a PKI, Part II: Configuring IIS...
    - Creating Test and Production Sites with Only...
    - Authentication and Authorization
    - Beefing Up IIS: 10 Tips From A Former Solari...
    - An Introduction To ISAPI
    - Secure Your Web Server With SSL
    - Introduction to HTML and ASP
    - Instructions to help in Designing your own C...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway