Determining IIS Options via C#

Hello. For my work, I'm automating system validation to be performed prior to installations of our software. One of the steps is to verify that certain options like "Common Files," "Internet Information Services Snap-IN", and "World Wide Web Server" are installed. I know how to verify this through Add/Remove Windows Components, yet I'm not sure how, or even if it's possible, to verify such things through the use of C# (which I'm writing the program in). Any help would be greatly appreciated.

Answer this question

Determining IIS Options via C#

  • dnhxx

    A simple google search for "programmatic iis" reveals several useful results.. also, this looks like a good article http://dotnetjunkies.com/WebLog/ramdash/articles/21777.aspx.

    You could use something like this to get a list of services... http://msdn.microsoft.com/library/default.asp url=/library/en-us/vbcon/html/vbtskretrievinglistsofservices.asp

    Lastly, this may help find the common files directory.. http://www.vbdotnetheaven.com/Code/Oct2003/2178.asp
    OR http://blogs.msdn.com/csharpfaq/archive/2004/12/02/273785.aspx

    Ain't google great Smile

  • OsoPolar2

    Hello again. I'm still not finding anything on this. I tried looking through the MetaBase via MetaEdit and searched through the Registry with just about anything related and browsed through a lot of it. As far as the "Common Files" component of IIS, that's just the actual directory structure with required files, right Secondly, the W3SVC is easy enough to verify through WMI. I'm still completely lost on how to find if Internet Services Manager and the IIS Snap-In are checked within the IIS options and find out programmatically to be part of automated software. Thanks ahead of time, Dan
  • asmasemsema

    i think you will find every thing saved in the registry
    search for what you need  and see what is write in the registry and chek for it

    as i know there is some components saved here
    HKLM/Software/microsoft/active setup/installed components


  • bmoreno

    Google is great, but I know how to view and administer services, but it's the components/options within IIS I'm trying to find out. Like if you were to go to Control Panel->Add/Remove Programs->Add/Remote Windows Components and you went to IIS and clicked "Details" I think the button's called, there's a list of components that can be installed. I'm wondering how to find out if they're checked or not programmatically. Thanks.


  • count zero 1942

    Hi

    The following code will help you get the list of services running in OS.

    From the list you try to serch the services required for your installation.

    To run my code please follow the following instractions

    Drag and Drop one listbox in the form

    Write the following code to view the services

    -------------------------------------------------------------

    System.ServiceProcess.ServiceController[] spArr = System.ServiceProcess.ServiceController.GetServices();

    foreach(System.ServiceProcess.ServiceController s in spArr)

    {

    listBox1.Items.Add(s.ServiceName);

    }

    This way you can get an idea. For your purpose you need to change

    the code.


  • Determining IIS Options via C#