in

Agramont.net

Virtualiztion, Software + Services, & Enterprise Architectures

Provware

How To: View Application Pool Identity for an IIS Website

This example will show you how to create a new website using the Provware Framework (Build 001).

  1. Create a reference pointing to the Provware.Framework.dll assembly.
  2. Add a directive to use the "Provware.Framework.Web" namespace

    using Provware.Framework.Web;

  3. Add the following code to your C# application


            WebManager wm = new WebManager();
            // Connect to Server
            WebServer ws = wm.Connect("localhost");
           
            // Bind to site by SiteName (Provwware Terminology)/ServerComment
            Site defaultWeb = ws.Sites["Default Website"];

            // Get the Application Pool ID
            string defaultWebPool = defaultWeb.IIsWebServer.AppPoolId;

            // Bind to the Application Pool Object.
            ApplicationPool pool = ws.ApplicationPools[defaultWebPool];

            Console.WriteLine(pool.IIsApplicationPool.WAMUserName);

Published Jul 31 2006, 01:59 PM by agramont
Filed under: , ,

Comments

 

Conrad Agramont's Blog said:

Last night, I posted the first build of the Provware Framework on my site (http://agramont.net/files/14/default.aspx).

July 31, 2006 7:26 PM
 

Conrad Agramont's WebLog said:

Last night, I posted the first build of the Provware Framework on my site (http://agramont.net/files/14/default.aspx).

July 31, 2006 7:26 PM
 

mmiika said:

Have you stopped development of this unique framework? Could be great to get it "finished" as there are not too many ways to control IIS.... how about open sourcing it somewhere?

The appPools are not initialized properly for each site. Every single site seems to think it's appPoolId is "DefaultAppPool". Also saw a bug in Provware.Framework.Web.ApplicationPools, the Add method is now _apps.Add(ApplicationPool, ApplicationPool) though it should say _apps.Add(ApplicationPool.Name, ApplicationPool)

April 25, 2007 11:30 PM

Leave a Comment

(required)  
(optional)
(required)  
Add

About agramont

Conrad Agramont is the Owner and a Technology Advisor for Agramont Services, LLC. For more information on Conrad and Agramont Services, please visit: http://www.agramontservices.com/about.aspx
Copyright Agramont.net, 2009. all rights reserved