November 2010 (1)
August 2010 (1)
July 2010 (1)
June 2010 (3)
July 2009 (3)
June 2009 (1)
May 2009 (1)
February 2009 (1)
January 2009 (1)
November 2008 (3)
October 2008 (4)
September 2008 (9)
August 2008 (6)
July 2008 (3)
June 2008 (3)
January 2008 (1)
November 2007 (2)
October 2007 (6)
September 2007 (5)
August 2007 (22)
July 2007 (6)
June 2007 (1)
May 2007 (3)
April 2007 (27)
March 2007 (8)
February 2007 (6)
September 2006 (2)
August 2006 (4)
July 2006 (9)
June 2006 (17)
May 2006 (20)
April 2006 (12)
March 2006 (9)
February 2006 (4)
January 2006 (3)
December 2005 (2)
November 2005 (4)
October 2005 (5)
September 2005 (37)
August 2005 (83)
July 2005 (6)

Active Directory / LDAP (0)
ASP.Net (19)
Blackberry Development (4)
c# (34)
c++ (3)
Code Camp (1)
Excel (1)
Exchange (3)
Front Page 2003 (6)
FTP User Editor (4)
HTML / CSS / DHTML (8)
IIS (146)
IIS - Log Parser (7)
IIS / FTP (12)
IIS / Tools / Administration (42)
IIS / Tools / Authentication (6)
IIS / Tools / Compression (8)
IIS / Tools / Crash & Hang (12)
IIS / Tools / ISAPI Filters (17)
IIS / Tools / Log Files (17)
IIS / Tools / Scripts (28)
IIS / Tools / Security (9)
IIS / Tools / SSL (6)
IIS 7 (3)
Internet Information Server (1)
Me (Chris Crowe) (6)
MIME Types (1)
Misc (72)
Oulook Express (2)
Silverlight (1)
SQL Server (27)
SQL Server CTE (1)
Vista (15)
Vista Gadgets (8)
Visual Studio (11)
Voice over BroadBand (1)
Windows (33)
Windows Powershell (3)
Windows Sharepoint Services (0)
Windows Sharepoint Services (15)
Windows Vista (14)
Wine Cellar (1)
WMI (8)
IIS (146) blog.crowe.co.nz.Models.Category

IIS

WebMatrix - a complete Web development stack that integrates a Web server, Database and more

WebMatrix includes a complete Web development stack that integrates a Web server (IIS Developer Express), database (Microsoft SQL Server Compact 4.0), programming model (ASP.NET Web pages with Razor syntax), and a tool (WebMatrix Beta) into a seamless experience.  You can use WebMatrix to streamline the way you create an ASP.NET Web site from templates, or by starting a new Web site by using the world’s most popular free and open source (ASP.NET or PHP) apps like DotNetNuke, Umbraco, WordPress, or Joomla!. With WebMatrix you can code your Web sites, customize them, optimize them for good search engine ranking, test them, and deploy them to an Internet hosting company, all through the tool.

Learn more about WebMatrix through:

For additional resources, visit:


IIS7.0 Web Dav Module Bug

There is a bug in the IIS7 Web Dav Module shown below

WebDav1

WebDav2

The bug is that if you have a file or folder with an ampersand “&” character it will cause an error when using Windows Explorer. We installed this on a Windows 2008 Server 32 bit version at work and opened it up to users.

When a user browsed a folder with a file or child folder that contained an ampersand they received the following message

error

The fix is to either install WebDav 7.5 for IIS 7.0 or to install a hotfix. This hotfix rollup resolves the following issues that occur when you use the WebDAV module for IIS 7.0:

  • The PROPFIND responses are truncated at 4 megabytes (MB).
  • Some characters are not escaped correctly in the PROPFIND responses.
  • Virtual Directory enumeration does not work as expected.
  • Plus signs are converted to spaces in PUT request URLs.
  • The WebDAV handler mapping is not added when you reinstall the WebDAV module.
  • Request filtering settings are not configured when you enable WebDAV by using the UI.

 

A hotfix rollup is available for the out-of-band WebDAV module for IIS 7.0
http://support.microsoft.com/default.aspx/kb/957001

 

WebDav 7.5 for IIS 7.0 Module : 32Bit Version
http://www.iis.net/downloads/default.aspx?tabid=34&g=6&i=1621

 

WebDav 7.5 for IIS 7.0 Module : 64Bit Version
http://www.iis.net/downloads/default.aspx?tabid=34&i=1618&g=6

 

WebDav 7.5 for IIS 7.0 Documentation
http://go.microsoft.com/fwlink/?LinkId=105146


Code Camp in Christchurch, New Zealand in November 2007

I see that there is now offical talk of a Code Camp in Christchurch, New Zealand in November 2007 which is good to see. I hope for some confirmed dates soon.

This is great news as the Mainland as we call it (the South Island of New Zealand) has never had a Code Camp before.

For pre-registrations and more details see http://dot.net.nz/Default.aspx?tabid=108 

The theme of the code camp is Next generation, back to basics. 

New releases of C#, VB, .Net, ASP and SQL are iminent.  This code camp will focus on getting up to speed with all of this, plus cover migration stratigies and many non-technology specific topics such as Architecture and Development Life Cycle.  Hopefully something for everyone - noobs, gurus, youg and old.

I have been asked to speak on IIS 7 and will be providing a session on this somewhere over the two day event.

I also spoke to Daniel Wissa ( at TechEd 2007) who runs the Christchurch .NET user group with Peter Jones [MVP] about running a shared session some time this year on Windows Vista Gadget Development. The code camp may be a good time for this session as well.

 I am trying to get some sponser support as well - but I will keep it quiet until I know the result.


IIS7 Access Denied when using the IIS 7 Manager

While working on IIS 7 this morning I got the following error while trying to save some configuration settings to my Default Web Site

"
There was an error while performing this operation.

Details:

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
"

The error message displayed was not that friendly but I got a general idea - unable to save my changes!

There are a couple of clues :

  • Only occurs while saving - so sounds permissions related
  • The line in the status bar says "Configuration: 'Default Web Site' web.config".  What this means is that the UI is going to save the changes to the web.config file in the home directory of the 'default web site'

Apon checking the web.config file I noticed that the Read Only attribute was set, and this was causing the issue above, maybe the UI should check if the web.config file is marked as read only and warn the user - I will suggest this to the IIS product team.


Starting and Stopping a Web Site And Application Pool

I had a request last week for the following:

I'm trying to do the following:

  1. Stop a IIS website
  2. Stop an App Pool
  3. Start the App Pool
  4. Start the Website

From what I can see here, I can use the example for the "starting an application pool" for the steps 2 & 3.

I have found that you can use iisweb.vbs to do steps 1 & 4.

 But how link them in the order above?

 Hope you can give me some pointers

 

The following code sample in VBScript allows you to do that with the following points of interest.

  • The Default Web Site is assumed - WebSiteID = 1, you can change this to any other web site by changing the ID with the ID of the other web site. There is a script called FindWeb.VBS or you can look at the log folder name and get the web site id from that - see http://blog.crowe.co.nz/archive/2007/08/04/IIS-Web-Site-Identifiers.aspx
  • There is only 1 site using the AppPool - well not technically true, if you run this and there is more than one web site using the app pool then it will be down while the app pool restarts.

Here is the code, save to StopAndStartSiteAndAppPool.VBS file and then run in a CMD.EXE prompt using the following syntax:

cscript StopAndStartSiteAndAppPool.VBS

 

Option Explicit

Dim WebSiteID, objWebSite, ObjAppPool

WebSiteID = "1"
Set objWebSite = GetObject("IIS://localhost/W3SVC/" & WebSiteID)
WScript.Echo "Stopping Web Site : " & objWebSite.ServerComment \
objWebSite.Stop()

wscript.echo "Stopping Application Pool : " & objWebSite.AppPoolID
Set objAppPool = GetObject("IIS://localhost/W3SVC/AppPools/" & objWebSite.AppPoolID)
objAppPool.Stop()

wscript.echo "Starting Application Pool : " & objWebSite.AppPoolID
objAppPool.Start()

WScript.Echo "Starting Web Site : " & objWebSite.ServerComment
objWebSite.Start()

You can also view/save the script from here.


Microsoft.com Operations Team Opens Up On Deploying IIS7 Early
I met up with Eric Woersching (who is a Technical Program Manager for IIS) while at TechEd in Auckland this last week and found that he had a great post on how the  Microsoft.com Ops team installed IIS 7 and Windows Server 2008 into their environment .

There is a 38 Minute video available on his blog site that is well worth a look if you are interested in this type of migration which I assume we all are as we will all have to do this at some point.

For more details see http://blogs.iis.net/ewoersch/archive/2007/06/27/video-microsoft-com-operations-team-opens-up-on-deploying-iis7-early.aspx

To learn more about how the Ops Team for MSCom uses IIS to host and manage one of the busiest sites in the world, check out their team blog at http://blogs.msdn.com/mscom.


IIS Product Team

I was talking with Eric Deily today at TechEd New Zealand in Auckland and he was discussing the size of the IIS product team.

Te team basically consists of :

  • 8 or 9 Product Managers
  • 18 Testers
  • 16 Developers

I would have assumed that there would be more than this but I always knew it was a small team.


IIS Web Site Identifiers

Normally you do not need to be concerned about web site identifiers, these are the actual ID's that reference the web site to IIS. Normally we just use the web site description such as Default Web Site or in my case blog.crowe.co.nz or something similar.

But if you are interested in writing scripts you normally reference sites using the Web Site Instance ID.

In IIS 6 the IIS Manager shows you a column called Idenfitier and this is the actual ID that references the web site. This was not visible in Windows 2000 (IIS 5) or Windows XP (IIS 5.1) and we had to use different methods to see the identifier.

Using IIS 7 on Windows Vista you can see a column called ID which is the Web Site Instance ID

The Default Web Site always has an identifier of 1.

All other web sites on IIS 6 have web site idenfieir's that look like random numbers. The fact is that this is not the case and the identifier is generated based on the description of the web site. This is so that if you have a server farm as long as the descripiton is the same you will end up with the same web site identifier. See this article for more details on the way that these identifiers are generated.

 Another way to identify the web site instance id is to look at the Logging Properties of a particular web site.

As you can see above the highlighted area shows the web site instance id. This is still a valid method for people using IIS 5 and IIS 5.1.

IIS 7 on Windows Vista does not include a logging configuration option - did they just forget it?

How about if you want to use a script to identify a web site?

IIS comes with a script called findweb.vbs that you can use to find a particular web site. This script is stored in c:\inetpub\adminscripts by default.

To use it you need to open a CMD.EXE command prompt and then use the cscript.exe utility to run the script. You also need to specify parameters to get the script to do what you want.

In this case I was interested in finding a web site called photos.crowe.co.nz

How about writing your own VB Script to list the site and the instance id?

Running the script above will display the web site Instance ID and the Description of the site.

 


IISxpress 2.1 for Windows 2003, Vista, XP and 2000 now available

You can now download IISxpress 2.1 for Windows Vista, 2003, XP and 2000 from the download area of RipCord Software. This version will also install and run on Windows Server "Longhorn" Beta 3 (build 6001).

The major features of this release are:

  • Now supports Windows Vista RTM and Windows Server "Longhorn" Beta 3.
  • Compression Cache - static content will be stored in the cache allowing for very fast compressed responses.
  • User-definable CPU Loading Model - on a multi-CPU system you can specify which CPU cores are used for compression tasks.
  • Update check - check that you have the latest version of the software.
  • The installer and all binaries are now signed to prevent tampering.

Screenshots:

IISxpress Cache configuration page

The compression cache stores the most recent compressed responses. You can specify the size of the cache and the number of responses to store. Responses served from the cache can be up to 10 times faster than a full compression pass.


IISxpress Cache configuration page

Specify the way IISxpress uses your CPUs for compression tasks. Select from Automatic, Manual or None. In Automatic mode IISxpress will allocate a CPU for each response. In Manual mode you specify which CPU cores IISxpress is allowed to use. When None is selected the Operating System manages the division of the compression tasks.


IISxpress Exclude URIs page

When you use IISxpress you can control which parts of your web sites are compressed. Here all the folders below FlexWiki will not be compressed (they are shown in red).

See http://www.ripcordsoftware.com/IISxpress/default.aspx


Enabling SSL on IIS 7.0 Using Self-Signed Certificates

Scott Guthrie has an article on using Self Signed Certificates with IIS and how to enable it in under 30 seconds.

Here is a primer...

SSL enables browsers to communicate with a web-server over a secure channel that prevents eavesdropping, tampering and message forgery.  You should always use SSL for login pages where users are entering usernames/passwords, as well as for all other sensitive pages on sites (for example: account pages that show financial or personal information). 

Configuring SSL on Windows with previous versions of IIS has been a pain.  Figuring out how to install and manage a certificate, and then associate it with a web-site, is something I bet most web developers don't know how to enable.

The good news is that IIS 7.0 makes it radically easier to configure and enable SSL.  IIS 7.0 also now has built-in support for creating "Self Signed Certificates" that enable you to easily create test/personal certificates that you can use to quickly SSL enable a site for development or test purposes. 

Using IIS 7.0 you can SSL enable an existing web site in under 30 seconds.  The below tutorial demonstrates how to-do this.

For the rest of the article see his article at http://weblogs.asp.net/scottgu/archive/2007/04/06/tip-trick-enabling-ssl-on-iis7-using-self-signed-certificates.aspx

 


Just a small update on the IISxpress 2.1 beta....

I have been running the IISxpress 2.1 beta for 4 days now with no problems at all. The live stats are displayed in the top right of this web site, but in 4 days it has accumilated the follows stats.

Compression Statistics

Responses:

6,349

Uncompressed:

146,085 KB

Compressed:

31,712 KB

Savings:

78.3 %

That is great news for me since the blog site was taking about 80% of my monthly allocation of bandwidth, it will be interesting at the end of the month to see the savings.


New IIS 7 Videos that may help you decide if IIS 7 is the way you should be thinking....

Eric Woersching, the IIS Product Manager, had the wild idea of putting these together as a way to get the message out about IIS7.  Developer Evangelist Asli Bilgin stepped up to do the presentation and the rest is history.  If you want to learn more about IIS7, check out these cool videos:

Developer's introduction to IIS7

IIS7 in Windows Vista

ASP.net integration in IIS7

Extensibility in IIS7

What ever happened to the IIS Evangelist Brett Hill?, he keeps pretty quiet for an Evangelist!


IISxpress 2.1 (beta) - Ripcord Software wants you

Ripcord Software has been working hard on their new version of IISxpress. IISxpress is a powerful and highly configurable compression plug-in for IIS. IISxpress will significantly reduce the bandwidth requirements of your web site, reducing your costs and giving your users the best web browsing experience possible.

Some of the features of this product

  • Control your IIS compression settings by file type, content type, URI (virtual directory) and IP address.
  • View in real-time your IIS server's performance; monitor CPU usage, memory usage and compression effectiveness.
  • Compatible with all major browsers: Internet Explorer, Mozilla, Firefox, Opera and Safari. 


    This beta is version 2.1 for 32bit and 64bit Windows Vista, 2003, XP and 2000. This version will also install and run on Windows Server "Longhorn" build 5600.

  • The major features of this release are:

    • Now supports Windows Vista RTM and Windows Server "Longhorn" 5600.
    • Compression Cache - static content will be stored in the cache allowing for very fast compressed responses.
    • User-definable CPU Loading Model - on a multi-CPU system you can specify which CPU cores are used for compression tasks.
    • Update check - check that you have the latest version of the software.
    • The installer and all binaries are now signed to prevent tampering.

    Screenshots:

    You can see how the compression can work - requesting my Home Page would normally return 85KB, but with the IISXpress 2.1 it is now returning only 15KB, that is an 82% saving on bandwidth.

    Note: Not all files will compress this much, but this does show you how much you could save.

    *IISxpress Cache configuration page

    The compression cache stores the most recent compressed responses. You can specify the size of the cache and the number of responses to store. Responses served from the cache can be up to 10 times faster than a full compression pass.

    IISxpress Cache configuration page

    Specify the way IISxpress uses your CPUs for compression tasks. Select from Automatic, Manual or None. In Automatic mode IISxpress will allocate a CPU for each response. In Manual mode you specify which CPU cores IISxpress is allowed to use. When None is selected the Operating System manages the division of the compression tasks.

    IISxpress Exclude URIs page

    When you use IISxpress you can control which parts of your web sites are compressed. Here all the folders below FlexWiki will not be compressed (they are shown in red).

    Great news for workstation users of IISxpress, version 2.1.

    When version 2.1 is released it will be available for FREE for all users of Windows Vista, Windows XP Professional and Windows 2000 Professional.

    Take the IISxpress SpeedTest challenge.

    Click here or here to see what HTTP compression could do for you.

    Download here

  • http://www.ripcordsoftware.com/cs/files/default.aspx


  • Downloading Microsoft Vista gadgets on Windows 2003 IIS 6

    When you try to download a Microsoft Vista Gadget on IIS 6 you will by default get a 404 error if you have not configured a mime type for .gadget

    The correct mime type is:

    Extension  :  .gadget
    Mimetype  :  application/x-windows-gadget

     

    Note: There is a “.” before the gadget above in the extension


    Microsoft releases a new download center for IIS (everything in one place)

    DownloadCENTER for IIS.net has been released! 

    The DownloadCENTER at IIS.net, is a community hotspot for discovering, sharing, reviewing and promoting IIS-related solutions in a single place.  Dozens of existing downloads, for all versions of IIS – both from Microsoft and the community – are already available in DownloadCENTER today. 

    This new feature of IIS.net is particularly relevant with the release of IIS7 in Windows Vista.  The latest release of Microsoft’s Web server has a completely modular architecture which features over forty pluggable components that can be easily added, removed or even replaced with custom implementations. 

    This powerful extensibility support is available to both .NET and C/C++ developers.  In the future, DownloadCENTER is expected to house a large number of IIS7 extensions submitted by not only the IIS team but the developers and partner ISVs of the IIS community as well.

    To learn more about the DownloadCenter, read IIS Product Unit Manager, Bill Staples’ blog post about it or check it out yourself today!

     


    Changing the default FTP site to Isolate Users using Active Directory

    If you have installed the FTP server for IIS 6 you will notice that it is not configured to isolate users either locally or by using Active Directory and that there is no UI to enable this!

    There are two ways to change user isolation:

    1. Create a new FTP site and configure it then.
    2. Adjust the IIS Metabase properties using a script

    Option #1 above is quite simply and does not really need any explaining. Just create a new FTP site and follow the promtps.

    Option #2 is where this article is going to concentrate on.

    We can either write a simple ADSI/WMI script or we can use the adsutil.VBS script - we are going to concentrate on the adsutil.VBS script.

    First things is how does IIS determine the user isolation mode?

    IIS uses a metabase property called UserIsolationMode to control user isolation in association with ADConnectionsUserName, ADConnectionsPassword and DefaultLogonDomain properties.

    UserIsolationMode

    The UserIsolationMode can only be one of the following values.

    • 0 = Not Isolated
    • 1 = Isolated (Locally)
    • 2 = Isolated using Active Directory

    When UserIsolationMode = 0

    There is no user isolation in this mode, this is the default setting.

    When UserIsolationMode = 1

    When a client authenticates using local or domain accounts and is then sent to a folder under the root that matches the user name. This setting is called "Isolated (Locally)," and it supports users who do not want to use Active Directory.

    When UserIsolationMode = 2

    User isolation is dependent on Active Directory. This setting is called "Isolated (Active Directory)," and it is primarily used by Internet service providers (ISPs) and other customers who want to set up large numbers of FTP accounts.

    When using this mode the following properties must also be configured.

    • ADConnectionsUserName
    • ADConnectionsPassword
    • DefaultLogonDomain.

    The ADConnectionsUserName specifies the user account ( without Domain ) that will be used to communicate with Active Directory to read the ms-IIS-FTP-Dir and ms-IIS-FTP-Root Active Directory attributes. The ADConnectionsPassword simply specifies the Password for the Username and the DefaultLogonDomain is the domain for the user account. 

    Note: The UserIsolationMode key is by default not set in the IIS metabase for the default FTP site and defaults to a value of 0 (Not Isolated)

     

    Using ADSUTIL.VBS to change to Active Directory User Isolation Mode

    Adsutil.vbs is installed into c:\inetpub\adminscripts by default.

    We will make the following assumptions for setting up User Isolation

    • We have backed up the IIS Metabase using the UI - if you have not DO IT NOW! 
      ( Open IIS Manager, Right click Server Name, All Properties, Backup/Restore configuration)
    • We are going to change the default FTP site user isolation mode.
    • We are going to Isolate users using Active Directory.
    • We are going to use an account of TestDomain\TestUserName to gain access to Active Directory with a password of $Password_

    To determine the current user isolation mode we will run the following command from a CMD.EXE prompt.

    cscript adsutil.vbs get MSFTPSVC/1/UserIsolationMode

    Note: In the above code we see that the value is not set! this is the default for the Default FTP Site

    To set the UserIsolationMode to 2 which is Active Directory Isolation we issue the following command.

    cscript adsutil.vbs set MSFTPSVC/1/UserIsolationMode 2

    Note: The result is that we have now configured the default FTP site to use Active Directory Isolation (2)

    But: We have not configured any credentials to be used to allow the server to talk to Active Directory yet!

    We now need to configure the user account that will be used to communicate with Active Directory

    The following commands will do this

    cscript adsutil.vbs set MSFTPSVC/1/ADConnectionsUserName TestUserName
    cscript adsutil.vbs set MSFTPSVC/1/ADConnectionsPassword $Password_
    cscript adsutil.vbs set MSFTPSVC/1/DefaultLogonDomain TestDomain

    If you now right clicked on the default FTP site in the IIS Manager and selected properties you would see that it is different.

         
    Active Directory Isolation   Default - No User Isolation

     

    To restore the UserIsolationMode to the default, which is 0 we simply issue the following command.

    cscript adsutil.vbs set MSFTPSVC/1/UserIsolationMode 0

     

    A free FTP User Account Editor for Active Directory

    The following application is free and comes with full source code written in c#. You can use this application to easily configure the ms-IIS-FTP-Root and ms-IIS-FTP-Dir Active Directory attributes for 1 or more users using a very simple UI.

    To read more or to download the application see this blog post - http://blog.crowe.co.nz/archive/2006/03/09/594.aspx

    Some additional references::


    IIS 6 - Creating an application and setting the application pool using ADSI
    I received a request from visitor to my blog on how to set an application pool to a new folder he created.

    "

    I have a small web server running IIS 6 and I host small sites for friends and family all under one domain. To keep them separate I put each of their sites into a subfolder and drop it into different pools.

    To date I've been doing this manually.  I've been trying to get my mind wrapped around this ADSI stuff to automate this process a bit but I'm coming up short.

    Here's what I do now.. if you have a few moments can you tell me how I might go about automating this process?

    1. I make a subfolder (call it Test) in the root of my website.
    2. I go into IIS Manager, expand the website, then right click on Test / Properties.
    3. I click Create to make it into an application.
    4. I change the application pool from Default to "familypool" then Apply.
    "

     

    The following code will allow you to create an application and assign the application pool "familypool" to the new directory. Note the application pool “familypool“ must already have been created.

    option explicit
    
    dim IIsWebVDirObj
    dim IIsWebVDirRootObj
    dim NewFolderName
    
    NewFolderName = "Test"
    
    const CreateNewApplicationPool = true
    const UseExistingApplicationPool = false
    
    
    ' Create the Metabase entry
    Set IIsWebVDirRootObj = GetObject("IIS://LocalHost/W3SVC/1/Root")
    Set IIsWebVDirObj = IIsWebVDirRootObj.Create("IIsWebDirectory", NewFolderName)
    
    IIsWebVDirObj.AppCreate3 2, " familypool", UseExistingApplicationPool
    IIsWebVDirObj.AppFriendlyName = "My App Friendly Name"
    IIsWebVDirObj.SetInfo
    

     

    In the code above we have made some assumptions:

    • The web site we are assigning it to is the default web site. This has an instance ID of 1.
    • The IISWebDirectory does not exist in the Metabase. If it does it will cause an error as would be the case if you run the code twice.

    In the case of the 2nd assumption above we would need to change the code from

    Set IIsWebVDirRootObj = GetObject("IIS://LocalHost/W3SVC/1/Root")
    Set IIsWebVDirObj = IIsWebVDirRootObj.Create("IIsWebDirectory", NewFolderName)

    to

    ' Load the Metabase entry if it does exist
    Set IIsWebVDirObj = GetObject("IIS://localhost/W3SVC/1/Root/" & NewFolderName)
     


    IIS 6 Application Pools and ADSI

    An application pool provides you with a way of isolating Web sites and Directories from each other even though they are being hosted on a common server. Each application pool is given its own set of server resources and can be configured with different identities. That way, if a Web site crashes, it won’t effect sites in other application pools.

    A example of this is a Web site which has a memory leak. If all of the Web sites hosted on a particular server were to share the system resources as was the case with IIS 5.1 and earlier and one of the Web sites had a memory leak, it could potentially take memory away from the other hosted sites.

    If the leaky site were in its own application pool though, the memory leak would not effect any other site because each application pool has its own server resources including memory.

    On earlier versions of IIS you could only configure your sites to run either Low ( In Process ) with the IIS Engine, Medium ( Pooled ) where all applications shared a pool of memory, and High (Out Of Process). The problem with this is that a bad application could depending on the isolation level take down the IIS server, or all other sites in the Medium ( Pooled ) model.

    Each application pool can be recycled based on a memory limit, the time of day, a number of requests or just after a period of time. Each application pool can also run with its own identity which can be either Local System, Local Service, Network Service or a custom credential.

    Application pools are available only when IIS is running in worker process isolation mode (this is the default). If you are running IIS in IIS 5 isolation mode, then the application pools will not be accessible to you.

    There is only one application pool by default called DefaultAppPool. When you create new Web sites, the newly created sites by default will use the DefaultAppPool unless you reconfigure the site after it is created. IIS does not automatically create a separate application pool for each Web site.

    Note: If you are running ASP.NET 1.1 and 2.0 then they must run in two different application pools as you can only load one version of the .NET framework into an application pool.

    Below are a number of very simple scripts that you could use to view / add and edit application pools.

    Note: Application Pools are only supported on IIS 6 and later.

    Enumerating Application Pools

    This simple script will simply display the name of each application pool on the local server.

    option explicit
    
    dim objAppPools, objAppPool
    
    Set objAppPools = GetObject("IIS://localhost/W3SVC/AppPools")
    for each objAppPool in objAppPools
    	WScript.echo objAppPool.Name 
    next

     

    Enumerating Applications in an Application Pool

    This script will display the web sites / directories that are using the DefaultAppPool

    option explicit
    
    dim Applications, objAppPool, index
    
    Set objAppPool = GetObject("IIS://localhost/W3SVC/AppPools/DefaultAppPool")
    WScript.echo objAppPool.Name 
    
    Applications = objAppPool.EnumAppsInPool()
    for index = 0 to UBound(Applications)
    	WScript.echo "   " & Applications(index)
    next
    

     

    Enumerating Application Pool Properties

    This script will display all properties of an application pool by looking at the Schema object for an Application Pool.

    option explicit
    
    dim Applications, objAppPools, objAppPool, index, IIsSchemaObject
    dim PropertyName, IIsAppPoolObject, ValueList
    
    set IIsSchemaObject = GetObject("IIS://localhost/schema/IIsApplicationPool")
    set IIsAppPoolObject = GetObject("IIS://localhost/W3SVC/AppPools/DefaultAppPool")
    
    on error resume next
    
    For Each PropertyName In IIsSchemaObject.MandatoryProperties
    	WScript.echo PropertyName
    next
    
    For Each PropertyName In IIsSchemaObject.OptionalProperties
    	WScript.echo PropertyName
    	ValueList = IIsAppPoolObject.Get(PropertyName)
    	if (isArray(ValueList) = true) then
    		for index = lbound(ValueList) to ubound(ValueList)
    			WScript.echo " " & index & " - " & ValueList(index)
    		next
    	else
    		WScript.echo " " & ValueList
    	end if
    next
    

     

    Enumerating the Periodic Recycling of all Application Pools

    This script will display the recycling settings of all application pools. You may find that your application stops briefly and that could be caused by the application pool being recycled every 1740 minutes ( every 29 hours) which is the default.

    option explicit
    
    dim objAppPools, objAppPool, Schedule
    
    Set objAppPools = GetObject("IIS://localhost/W3SVC/AppPools")
    for each objAppPool in objAppPools
    	WScript.echo objAppPool.Name
    	WScript.echo "  Restart Time           : " & objAppPool.PeriodicRestartTime & " seconds"
    	WScript.echo "  Restart Requests       : " & objAppPool.PeriodicRestartRequests
    	WScript.echo "  Restart Memory         : " & objAppPool.PeriodicRestartMemory
    	WScript.echo "  Restart Private Memory : " & objAppPool.PeriodicRestartPrivateMemory
    	WScript.echo "  Restart Requests       : " & objAppPool.PeriodicRestartRequests
    	for each Schedule in objAppPool.PeriodicRestartSchedule
    		WScript.echo "  Restart At             : " & Schedule
    	next
    	WScript.echo
    next
    

     

    Creating an Application Pool

    This script will create a new application pool using the defaults.

    strAppPool = "MyAppPool1"
    Set objAppPools = GetObject("IIS://localhost/W3SVC/AppPools")
    Set objAppPool = objAppPools.Create("IIsApplicationPool", strAppPool)
    objAppPool.SetInfo

     

    Creating an Application Pool to run with a specific identity

    This script will create a new application pool to run as a custom identity. This custom identity could be a local or domain account. You will need to add the user account into the IIS_WPG group on the IIS server. This is because this group has been assigned permissions that the application pool will need to run properly.

    strAppPool = "MyAppPool2"
    Set objAppPools = GetObject("IIS://localhost/W3SVC/AppPools")
    Set objAppPool = objAppPools.Create("IIsApplicationPool", strAppPool)
    
    ' 0 = Local System
    ' 1 = Local Service
    ' 2 = Network Service
    ' 3 = Custom Identity -> also set WAMUserName and WAMUserPass
    objAppPool.AppPoolIdentityType = 3
    
    ' Note: WamUserName must be added to the IIS_WPG group to have correct security rights
    objAppPool.WAMUserName = "DOMAIN\Username"
    objAppPool.WAMUserPass = "Password"
    
    objAppPool.SetInfo

     

    Starting an Application Pool

    This script will allow you to start an application pool. You can also specify Stop() and Recycle()  instead of Start().

    option explicit
    
    dim objAppPool
    
    Set objAppPool = GetObject("IIS://localhost/W3SVC/AppPools/DefaultAppPool")
    objAppPool.Start()
    

     

    Hopefully these simple scripts will show you how easy Application Pools are to create and enumerate.


    VBScript - Modified version of Mk3Site.vbs

    This script is a modified version of the IIS 5 Mk3Site.vbs script.

    I had a request to do some work and the customer would pay me to re-write the script to support some additional features.

    I decided to do the work for free and donate the script to the community. It may have some use for some people.

    The new features are:

    • Ability to set the application protection to Low, Medium or High
    • Ability to set the Execute options to None, Scripts or Executables
    • Ability to change the log file period
    • Ability to change the log directory

    This script was updated from a previously updated script I wrote back in 2001 and is available from www.iisfaq.com

    The new features of that script were:

    • Ability to setup URL redirection while creating the site.

     You can download the script from here.

    '------------------------------------------------------------------------------------------------
    '
    ' This is a simple script to create a new virtual web server.
    '
    ' Usage: MakeWebSite      <--RootDirectory|-r ROOT DIRECTORY>
    '                         <--Comment|-t SERVER COMMENT>
    '                         [--computer|-c COMPUTER1[,COMPUTER2...]]
    '                         [--HostName|-h HOST NAME[,HOSTNAME2...]]
    '                         [--port|-o PORT NUM]
    '                         [--IPAddress|-i IP ADDRESS]
    '                         [--SiteNumber|-n SITENUMBER]
    '                         [--DontStart]
    '                         [--verbose|-v]
    '                         [--Write]"
    '                         [--Execute { NONE, SCRIPTS, EXECUTABLES } ]"
    '                         [--AppProtection { LOW, MEDIUM, HIGH } ]"
    '                         [--AppName Name]"
    '                         [--LogPeriod { DAILY, WEEKLY, MONTHLY, HOURLY} ]"
    '                         [--LogFolder LogFileDirectory]"
    '                         [--URL Redirectionpath]
    '                         [--URLExact]
    '                         [--URLChildOnly]
    '                         [--URLPermanent]
    '                         [--help|-?]
    '
    ' IP ADDRESS            The IP Address to assign to the new server.  Optional.
    ' HOST NAME             The host name of the web site for host headers.
    '      WARNING: Only use Host Name if DNS is set up find the server.
    ' PORT NUM              The port to which the server should bind
    ' ROOT DIRECTORY        Full path to the root directory for the new server.
    ' SERVER COMMENT        The server comment -- this is the name that appers in the MMC.
    ' SITENUMBER      The Site Number is the number in the path that the web server
    '      will be created at.  i.e. w3svc/3
    '
    ' Example 1: MakeWebSite.vbs -r D:\Roots\Company11 --DontStart -t "My Company Site"
    ' Example 2: MakeWebSite.vbs -r C:\Inetpub\wwwroot -t Test -o 8080
    '
    '
    ' Modified by chris crowe - www.iisfaq.com to support multiple host headers and URL Redirection
    '------------------------------------------------------------------------------------------------
    
    ' Force explicit declaration of all variables
    Option Explicit
    'On Error Resume Next
    Dim ArgIPAddress, ArgRootDirectory, ArgServerComment, ArgSkeletalDir, ArgHostName, ArgPort
    Dim ArgComputers, ArgStart
    Dim ArgSiteNumber
    Dim oArgs, ArgNum
    Dim verbose, FSO
    ' Chris Crowe - blog.crowe.co.nz
    dim ArgLogFolder
    dim ArgLogFilePeriod
    dim ArgAppFriendlyName
    dim ArgAppProtection
    dim ArgExecute
    dim ArgExecuteScripts
    dim ArgExecuteExecutables 
    dim ArgWrite
    const MD_LOGFILE_PERIOD_MAXSIZE = 0 ' Create new log file after reaching maximum size. 
    const MD_LOGFILE_PERIOD_DAILY   = 1 ' Create new log file daily. 
    const MD_LOGFILE_PERIOD_WEEKLY  = 2 ' Create new log file weekly. 
    const MD_LOGFILE_PERIOD_MONTHLY = 3 ' Create new log file monthly. 
    const MD_LOGFILE_PERIOD_HOURLY  = 4 ' Create a new log file hourly. 
    ' Chris Crowe - iisfaq.com
    Dim ArgURL, ArgURLExact, ArgURLChildOnly, ArgURLPermanent
    ArgIPAddress = ""
    ArgHostName = ""
    ArgPort = 80
    ArgStart = True
    ArgComputers = Array(1)
    ArgComputers(0) = "LocalHost"
    ArgSiteNumber = 0
    verbose = false
    ' Chris Crowe - blog.crowe.co.nz
    ArgLogFolder            = ""
    ArgLogFilePeriod        = ""
    ArgAppFriendlyName      = ""
    ArgAppProtection        = 2
    ArgExecute              = ""
    ArgWrite                = false
    ' Chris Crowe - iisfaq.com
    ArgURL = ""
    ArgURLChildonly = false
    ArgURLExact = false
    ArgURLPermanent = false
    Set oArgs = WScript.Arguments
    ArgNum = 0
    While ArgNum < oArgs.Count
     Select Case LCase(oArgs(ArgNum))
      Case "--port","-o":
       ArgNum = ArgNum + 1
       ArgPort = oArgs(ArgNum) 
      Case "--ipaddress","-i":
       ArgNum = ArgNum + 1
       ArgIPAddress = oArgs(ArgNum)
      Case "--rootdirectory","-r": 
       ArgNum = ArgNum + 1
       ArgRootDirectory = oArgs(ArgNum)
      Case "--comment","-t":
       ArgNum = ArgNum + 1
       ArgServerComment = oArgs(ArgNum)
      Case "--hostname","-h":
       ArgNum = ArgNum + 1
       ArgHostName = oArgs(ArgNum)
      Case "--computer","-c":
       ArgNum = ArgNum + 1
       ArgComputers = Split(oArgs(ArgNum), ",", -1)
      Case "--sitenumber","-n":
       ArgNum = ArgNum + 1
       ArgSiteNumber = CLng(oArgs(ArgNum))
            ' Chris Crowe - blog.crowe.co.nz
      Case "--logfolder": 
       ArgNum = ArgNum + 1
       ArgLogFolder = oArgs(ArgNum)
      Case "--logperiod": 
       ArgNum = ArgNum + 1
       ArgLogFilePeriod = oArgs(ArgNum)
      Case "--appname": 
       ArgNum = ArgNum + 1
       ArgAppFriendlyName = oArgs(ArgNum)
      Case "--appprotection": 
       ArgNum = ArgNum + 1
       ArgAppProtection= oArgs(ArgNum)
      Case "--execute": 
       ArgNum = ArgNum + 1
       ArgExecute = oArgs(ArgNum)
      Case "--write"
       ArgWrite = true
      
      ' Chris Crowe - iisfaq.com
      Case "--url","-u": 
       ArgNum = ArgNum + 1
       ArgURL = oArgs(ArgNum)
      Case "--urlexact"
       ArgURLEXACT = true
      Case "--urlchildonly"
       ArgURLChildOnly = true
      Case "--urlpermanent"
       ArgURLPERMANENT = true
       
      Case "--dontstart":
       ArgStart = False
      Case "--help","-?":
       Call DisplayUsage
      Case "--verbose", "-v":
       verbose = true
      Case Else:
       WScript.Echo "Unknown argument "& oArgs(ArgNum)
       Call DisplayUsage
     End Select 
     ArgNum = ArgNum + 1
    Wend
    ' Chris Crowe - iisfaq.com
    If (ArgRootDirectory = "") Then
     WScript.Echo "Missing Root Directory (Required even with URL redirection path)"
     WScript.Echo ""
     Call DisplayUsage
     WScript.Quit(1)
    End If
    ' Check if the root directory exists
    Set FSO = WScript.CreateObject("Scripting.FileSystemObject")
      if (FSO.FolderExists(ArgRootDirectory) = False) then
        WScript.echo "The specified root directory does not exist : '" & ArgRootDirectory & "'"
        WScript.Quit(2)
      end if
      
      
      ' Chris Crowe - July 2006
      if (ArgLogFolder > "") then
          if (FSO.FolderExists(ArgLogFolder) = False) then
            WScript.echo "The specified LogFolder directory does not exist : " & ArgLogFolder
            WScript.Quit(2)
          end if
      end if  
      
    Set FSO = Nothing
    
    ' Chris Crowe - July 2006
    if (ArgExecute> "") then
        ArgExecute = ucase(ArgExecute)
        if (ArgExecute = "NONE") then 
            ArgExecuteScripts = false
            ArgExecuteExecutables = false
        elseif (ArgExecute = "SCRIPTS") then 
            ArgExecuteScripts = true
            ArgExecuteExecutables = false
        elseif (ArgExecute = "EXECUTABLES") then 
            ArgExecuteScripts = true
            ArgExecuteExecutables = true
        else
          WScript.echo "The specified Execute value is invalid : " & ArgAppProtection
          WScript.Quit(2)
        end if
    end if
    if (ArgAppProtection > "") then
        ArgAppProtection = ucase(ArgAppProtection)
        if (ArgAppProtection = "LOW") then ArgAppProtection = 0
        if (ArgAppProtection = "INPROCESS") then ArgAppProtection = 0
        
        if (ArgAppProtection = "HIGH") then ArgAppProtection = 1
        if (ArgAppProtection = "OUTOFPROCESS") then ArgAppProtection = 1
        
        if (ArgAppProtection = "MEDIUM") then ArgAppProtection= 2
        if (ArgAppProtection = "POOLED") then ArgAppProtection = 2
        
        if ((ArgAppProtection = 0) or (ArgAppProtection = 1) or (ArgAppProtection = 2)) then
        else
          WScript.echo "The specified AppProtection value is invalid : " & ArgAppProtection
          WScript.Quit(2)
        end if
    end if  
    if (ArgLogFilePeriod > "") then
        ArgLogFilePeriod = ucase(ArgLogFilePeriod)
        if (ArgLogFilePeriod = "DAILY") then ArgLogFilePeriod = 1
        if (ArgLogFilePeriod = "WEEKLY") then ArgLogFilePeriod = 2   
        if (ArgLogFilePeriod = "MONTHLY") then ArgLogFilePeriod = 3
        if (ArgLogFilePeriod = "HOURLY") then ArgLogFilePeriod = 4
        
        if ((ArgLogFilePeriod= 0) or (ArgLogFilePeriod= 1) or (ArgLogFilePeriod= 2) or (ArgLogFilePeriod= 3)) then
        else
          WScript.echo "The specified LogFilePeriod is invalid : " & ArgLogFilePeriod
          WScript.Quit(2)
        end if
    end if  
    
    If (ArgServerComment = "") Then
     WScript.Echo "Missing Server Comment"
     WScript.Echo ""
     Call DisplayUsage
     WScript.Quit(1)
    End If
    ' end - chris Crowe - iisfaq.com
    ' chris Crowe - iisfaq.com
    Call ASTCreateWebSite(ArgIPAddress, ArgRootDirectory, ArgURL, ArgURLEXACT, ArgURLCHILDONLY, ArgURLPERMANENT, 
    ArgServerComment, ArgHostName, ArgPort, ArgComputers, ArgStart) ' chris Crowe - iisfaq.com Sub ASTCreateWebSite(IPAddress, RootDirectory, URL, ArgURLEXACT, ArgURLCHILDONLY, ArgURLPERMANENT,
    ServerComment, HostName, PortNum, Computers, Start) Dim w3svc, WebServer, NewWebServer, NewDir, Bindings, BindingString, NewBindings, ComputerIndex
    Dim Index, SiteObj, bDone Dim comp, BindingIndex, HostNameINdex, HostNames 'Chris Crowe - www.iisfaq.com Dim URLOPTIONS On Error Resume Next hostNames = Split(HostName,",") For ComputerIndex = 0 To UBound(Computers) comp = Computers(ComputerIndex) If ComputerIndex <> UBound(Computers) Then Trace "Creating web site on " & comp & "." End If ' Grab the web service object Err.Clear Set w3svc = GetObject("IIS://" & comp & "/w3svc") If Err.Number <> 0 Then Display "Unable to open: "&"IIS://" & comp & "/w3svc" End If Trace "Making sure this web server doesn't conflict with another..." For Each WebServer in w3svc If WebServer.Class = "IIsWebServer" Then Bindings = WebServer.ServerBindings For HostNameINdex = 0 To UBound(HostNames) for BindingIndex = 0 to Ubound(Bindings) BindingString = IpAddress & ":" & PortNum & ":" & HostNames(HostNameINdex) If (BindingString = bindings(BindingIndex)) Then Trace "The server bindings you specified are duplicated in another virtual web server." Trace "The Web Server name is [" & WebServer.ServerComment & "], Instance ID [" & WebServer.name & "]" Trace "The Conflicting Bindings are at index [" & bindingIndex & "], [" & bindings(BindingIndex) & "]" WScript.Quit (1) End If next next End If Next Index = 1 bDone = False Trace "Creating new web server..." ' If the user specified a SiteNumber, then use that. Otherwise, ' test successive numbers under w3svc until an unoccupied slot is found If ArgSiteNumber <> 0 Then Set NewWebServer = w3svc.Create("IIsWebServer", ArgSiteNumber) NewWebServer.SetInfo If (Err.Number <> 0) Then WScript.Echo "Couldn't create a web site with the specified number: " & ArgSiteNumber WScript.Quit (1) Else Err.Clear ' Verify that the newly created site can be retrieved Set SiteObj = GetObject("IIS://"&comp&"/w3svc/" & ArgSiteNumber) If (Err.Number = 0) Then bDone = True Trace "Web server created. Path is - "&"IIS://"&comp&"/w3svc/" & ArgSiteNumber Else WScript.Echo "Couldn't create a web site with the specified number: " & ArgSiteNumber WScript.Quit (1) End If End If Else While (Not bDone) Err.Clear Set SiteObj = GetObject("IIS://"&comp&"/w3svc/" & Index) If (Err.Number = 0) Then ' A web server is already defined at this position so increment Index = Index + 1 Else Err.Clear Set NewWebServer = w3svc.Create("IIsWebServer", Index) NewWebServer.SetInfo If (Err.Number <> 0) Then ' If call to Create failed then try the next number Index = Index + 1 Else Err.Clear ' Verify that the newly created site can be retrieved Set SiteObj = GetObject("IIS://"&comp&"/w3svc/" & Index) If (Err.Number = 0) Then bDone = True Trace "Web server created. Path is - "&"IIS://"&comp&"/w3svc/" & Index Else Index = Index + 1 End If End If End If ' sanity check If (Index > 10000) Then Trace "Seem to be unable to create new web server. Server number is "&Index&"." WScript.Quit (1) End If Wend End If on error goto 0 redim NewBindings (ubound(HostNames)) For HostNameINdex = 0 To UBound(HostNames) BindingString = IpAddress & ":" & PortNum & ":" & HostNames(HostNameINdex) Trace "Binding = " & BindingString NewBindings(HostNameINdex) = BindingString next ' Modified by Chris Crowe - July 2006 (Start) if (ArgLogFolder > "") then NewWebServer.LogFileDirectory = ArgLogFolder end if if (ArgLogFilePeriod > "") then NewWebServer.LogFilePeriod = ArgLogFilePeriod end if ' Modified by Chris Crowe - July 2006 (End) NewWebServer.ServerBindings = NewBindings NewWebServer.ServerComment = ServerComment NewWebServer.SetInfo ' Now create the root directory object. Trace "Setting the home directory..." Set NewDir = NewWebServer.Create("IIsWebVirtualDir", "ROOT") NewDir.Path = RootDirectory NewDir.AccessRead = true ' Chris Crowe - July 2006 if (ArgWrite = true) then NewDir.AccessWrite = true end if if (ArgExecute > "") then NewDir.AccessScript = ArgExecuteScripts NewDir.AccessExecute = ArgExecuteExecutables end if ' Modified by Chris crowe - January 2002 if (URL <> "") then trace "Redirection to a URL: " & URL URLOPTIONS= "" if (ArgURLEXACT = true) then URLOPTIONS = ", EXACT_DESTINATION" end if if (ArgURLCHILDONLY = true) then if (URLOPTIONS > "") then URLOPTIONS = URLOPTIONS & ", CHILD_ONLY" else URLOPTIONS = ", CHILD_ONLY" end if end if if (ArgURLPERMANENT = true) then if (URLOPTIONS > "") then URLOPTIONS = URLOPTIONS & ", PERMANENT" else URLOPTIONS = ", PERMANENT" end if end if trace "Redirection Flags : " & URLOPTIONS newDir.httpredirect= URL & URLOPTIONS end if ' Modified by Chris crowe - January 2002 Err.Clear NewDir.SetInfo ' Chris Crowe - July 2006 NewDir.AppCreate2 (ArgAppProtection) if (ArgAppFriendlyName > "") then NewDir.AppFriendlyName = ArgAppFriendlyName NewDir.SetInfo end if If (Err.Number = 0) Then Trace "Home directory set." Else Display "Error setting home directory." End If Trace "Web site created!" If Start = True Then Trace "Attempting to start new web server..." Err.Clear Set NewWebServer = GetObject("IIS://" & comp & "/w3svc/" & Index) NewWebServer.Start If Err.Number <> 0 Then Display "Error starting web server!" Err.Clear Else Trace "Web server started succesfully!" End If End If Next End Sub ' Display the usage message Sub DisplayUsage WScript.Echo "Usage: MakeWebSite <--RootDirectory|-r ROOT DIRECTORY>" WScript.Echo " <--Comment|-t SERVER COMMENT>" WScript.Echo " [--computer|-c COMPUTER1[,COMPUTER2...]]" WScript.Echo " [--port|-o PORT NUM]" WScript.Echo " [--IPAddress|-i IP ADDRESS]" WScript.Echo " [--HostName|-h HOST NAME[,HOSTNAME2...]]" WScript.Echo " [--SiteNumber|-n SITENUMBER]" WScript.Echo " [--AppProtection Level { LOW, MEDIUM, HIGH } ]" WScript.Echo " [--AppName Name]" WScript.Echo " [--Write]" WScript.Echo " [--Execute { NONE, SCRIPTS, EXECUTABLES } ]" WScript.Echo " [--LogPeriod LogFilePeriod { DAILY, WEEKLY, MONTHLY, HOURLY}]" WScript.Echo " [--LogFolder LogFileDirectory]" WScript.Echo " [--URL RedirectionPath]" WScript.Echo " [--URLExact]" WScript.Echo " [--URLChildOnly]" WScript.Echo " [--URLPermanent]" WScript.Echo " [--DontStart]" WScript.Echo " [--verbose|-v]" WScript.Echo " [--help|-?]" WScript.Echo "" WScript.Echo "WARNING: Only use Host Name if DNS is set up find the server." WScript.Echo "" WScript.Echo "Example 1: MakeWebSite.vbs -r D:\Roots\Company11 --DontStart -t ""My Company Site""" WScript.Echo "Example 2: MakeWebSite.vbs -r D:\Roots\Company11 -h ""www.iisfaq.com,www.iis.com"" --DontStart
    -t "
    "My Company Site""" WScript.Echo "Example 3: MakeWebSite.vbs -r D:\Roots\Company11 -i 192.168.0.1 -t ""My Company Site""
    --URL http://www.iisfaq.com --URLExact --URLPermanent"
    WScript.Echo "Example 4: MakeWebSite.vbs -r D:\Roots\Company11 --DontStart -t ""My Company Site""
    --LogPeriod MONTHLY --LogFolder c:\Root\Company1"
    WScript.Echo "Example 5: MakeWebSite.vbs -r D:\Roots\Company11 --DontStart -t ""My Company Site""
    --AppName XYZ --LogFolder c:\Root\Company1" WScript.Echo "" WScript.Echo "Note: URLRedirection requires a HTTP:// prefix and a root directory also!" WScript.Echo " Write enables write access to the directory" WScript.Echo "" WScript.Quit (1) End Sub Sub Display(Msg) WScript.Echo Now & ". Error Code: " & Hex(Err) & " - " & err.Description & " - " & Msg End Sub Sub Trace(Msg) if verbose = true then WScript.Echo Now & " : " & Msg end if End Sub

    VBScript - How to search all sites and host headers for a particular string of characters?

    The following script will allow you to search the local web server for all virtual servers that have been configured for a particular host header value.

    The script requires you to specify a value to seach for as a command line parameter.

    Example

    cscript EnumByHostHeader.vbs SearchString

    Where SearchString is some text to search for such as crowe

    cscript EnumByHostHeader.vbs crowe

    The expected result is something like the following

    Searching for CROWE in the host headers

    Web Site Instance ID - Server Comment - Host Header
    126606719 - photos.crowe.co.nz - PHOTOS.CROWE.CO.NZ
    1849151055 - rotties.crowe.co.nz - ROTTIES.CROWE.CO.NZ
    2021379493 - Blog (Maintenance) - BLOG.CROWE.CO.NZ
    415889539 - fish.crowe.co.nz - FISH.CROWE.CO.NZ


    on error resume next
    dim Contains
    Set ArgObj = WScript.Arguments
    If ArgObj.Count < 1 Then
    Wscript.echo "Please specify the name or part name to look for in the host header field!"
    Wscript.echo ""
    Wscript.echo "Example"
    Wscript.echo "  cscript EnumByHostHeader.vbs ccrowe"
    else
    Contains = ucase(ArgObj.Item(0))
    dim websrv, site
    dim Found
    dim webinfo
    Found = false
    WScript.echo "Searching for " & Contains & " in the host headers"
    WScript.echo ""
        WScript.echo "Web Site Instance ID - Server Comment - Host Header"
    set websrv = getobject("IIS://Localhost/W3SVC")
    if (err <> 0) then
    else
      err.Clear
      for each site in websrv
       if (site.classname = "IIsWebServer") then
        bindings = Site.ServerBindings
        For Index = LBound(bindings) To UBound(bindings)
         Values = split(bindings(Index), ":")
         HostHeader = ucase(Values(2))
         if (instr(HostHeader, Contains) > 0) then
          Found = true
          WScript.echo site.Name & " - " & _
                                site.ServerComment & " - " & _
                                HostHeader
         end if
        next
       end if
      next
    end if
    if (Found = false) then
      WScript.echo "The search term " & Contains & " was not found!"
    end if
    end if


    IIS Podcasts at channel9.msdn.com

    Brett Hill, IIS Technical Evangelist for Microsoft hosts these podcast shows dedicated exclusively to IIS.

    Every two weeks, expect a new podcast featuring members of the IIS 7 product team and other key players in IIS technology.

    Episode Time Release Date
    IIS Show #7 - Interview with Henry Seiler - IIS Team 10:57 6/27/2006
    IIS Show #6 - Interview with Pluralsight.com 13:11 5/3/2006
    IIS Show #5 - Interview with Scott Guthrie - http://weblogs.asp.net/scottgu/ 14:43 2/2/2006
    IIS Show #4 with Brett Hill 09:42 12/16/2005
    IIS Show #3 with Brett Hill - David Wang - http://blogs.msdn.com/david.wang 13:04 11/22/2005
    IIS Show #2 with Brett Hill - Rick Strahl - http://west-wind.com/weblog/ 09:19 10/21/2005
    IIS Show #1 with Brett Hill - http://iisanswers.com/brettblog 13:56 10/7/2005

    You can listen online or download in WMA or MP3 format at http://channel9.msdn.com/shows/IIS_Show

    Also see http://channel9.msdn.com/tags/IIS for more on IIS including videos on IIS 7 and debugging www.microsoft.com


    Some examples of scripting of IIS using ADSI, WMI from VB and C# including the new Microsoft.Web.Administration namespace

    Below are some simple examples of how to talk to IIS via ADSI, WMI and the new IIS 7 only .NET Managed Provider.

    The IIS ADSI Provider

    The IIS ADSI provider exposes COM Automation objects that you can use within command-line scripts, ASP pages, or custom applications to change IIS configuration values stored in the IIS metabase. IIS ADSI objects can be accessed and manipulated by any language that supports automation, such as Microsoft® Visual Basic® Scripting Edition (VBScript), Microsoft JScript®, Perl, Microsoft Active Server Pages (ASP), Visual Basic, Java, or Microsoft C++.

    The IIS WMI Provider

    Windows Management Instrumentation (WMI) is a technology that allows administrators to programmatically manage and configure the Windows operating system and Windows applications. Beginning with IIS 6.0, IIS includes a WMI provider that exposes programming interfaces that can be used to query and configure the IIS metabase.

    The Microsoft.Web.Administration namespace in IIS 7

     This is a new .NET managed namespace that will allow you to talk to IIS 7 and configure all aspects of the server. This API is designed to be simple to code against in an “intellisense-driven” sort of way. At the root level a class called ServerManager exposes all the functionality you will need. At this time it appears that this will not be able to be used from Windows XP but by the time Vista & Windows Server are released this may have been ported to run on a Windows XP client.
     

    For more details on these technologies see the following resources:


    C# -Using System.DirectoryServices and ADSI

    using System;
    using System.Collections.Generic;
    using System.Text;
    // Must be specified and a reference added to System.DirectoryServices
    using System.DirectoryServices;
    
    namespace Console_EnumSites_ADSI_CSharp
    {
        class Program
        {
            static void Main(string[] args)
            {
                DirectoryEntry entry = new DirectoryEntry("IIS://LocalHost/W3SVC");
                foreach (DirectoryEntry site in entry.Children)
                {
                    if (site.SchemaClassName == "IIsWebServer")
                    {
                        string ServerComment = site.Properties["ServerComment"].Value.ToString();
                        Console.WriteLine(ServerComment + " (" + site.Name + ")");
                    }
                }
            }
        }
    }
    

    VB -Using ADSI

    on error resume next
    
    dim websrv, site
    dim webinfo
    
    set websrv = getobject("IIS://Localhost/W3SVC")
    if (err <> 0) then
    else
        err.Clear
        for each site in websrv
            if (site.classname = "IIsWebServer") then
                WScript.echo Site.ServerComment & " (" & Site.Name & ")"
            end if
        next
    end if

    C# -Using System.Managment and WMI

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Management;
    
    namespace Console_EnumSites_WMI_CSharp
    {
        class Program
        {
            static void Main(string[] args)
            {
                ManagementScope oms = new ManagementScope(@"\\.\root\MicrosoftIISv2");
                oms.Connect();
    
                ObjectQuery oQuery = new ObjectQuery("select * from IISWebServerSetting");
                ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(oms, oQuery);
                foreach (ManagementObject oreturn in oSearcher.Get())
                {
                    Console.WriteLine(oreturn["ServerComment"]+" ("+oreturn["Name"]+")");
                }
                Console.Read();
            }
        }
    }
    

    C# -Using Microsoft.Web.Administration ( II7 Only )

    using System;
    using System.Collections.Generic;
    using System.Text;
    using Microsoft.Web.Administration;
    
    namespace Console_EnumSites
    {
        class Program
        {
            static void Main(string[] args)
            {
                ServerManager iisManager = new ServerManager();
    
                Console.WriteLine("Display IIS Sites in IIS 7");
                Console.WriteLine("".PadLeft(40,'-'));
                foreach(Site site in iisManager.Sites)
                {
                    Console.WriteLine("{0} {1}", site.Id.ToString().PadRight(12), site.Name);                
                }
                Console.Read();
            }
        }
    }
    

    IIS Metabase Explorer
    The IIS Metabase Explorer provides a graphical user interface for viewing and editing IIS metabase stores. You can use Metabase Explorer to export and import keys and subkeys, copy keys and subkeys, edit security settings for keys, and compare records within the metabase.

    This tool can be used to perform a wide variety of tasks to help you manage the IIS Metabase. For example, you can use it to back up or restore parts of the metabase. You can also use it to reset the default IIS Web site, or allow a non-administrator account to change the metabase by adding a restricted write access control list (ACL) to specific metabase nodes.

    Metabase Explorer can be used to edit the metabase for IIS versions 4.0, 5.0, and 6.0, and lets you connect to both local and remote metabases.

    To use Metabase Explorer, you’ll need to install the IIS 6.0 Resource Kit Tools (see Knowledge Base article 840671 The IIS 6.0 Resource Kit Tools for download details).

    MetabaseExplorer is compatible with the Microsoft® Windows® 2000, Windows XP Professional, and Windows Server 2003 operating systems. It also requires Microsoft® .NET Framework version 1.1


    c# - How to display the HttpExpires property and display its meaning...

    The HttpExpires property is documented at the following URL.

    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/3e1d9fbb-6910-4648-a2bb-11a945ca7980.mspx?mfr=true

    This simple c# console application will display the settings for the HttpExpires property at the root level of the default web site.

    Basically the value is encoded as follows:

    • If the value is a blank string then there is no content expiry.
    • If the value starts with a D, then it is using a dynamic expiration period. This period is appended after the D and is stored as the number of seconds in hexidecimal format.

      Example: “D, 0x15180”    - this 0x15180 is the same as 86,400 seconds or 1 day.
    • If the value starts with an S then the following value is a GMT time of when the expiration will take place.

      Example: “S, Sat, 08 Jul 2006 12:00:00 GMT”

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.DirectoryServices;
    namespace IISHTTPExpires
    {
        class Program
        {
            static void Main(string[] args)
            {         
                Console.WriteLine("IIS HTTP Expires - c#");
                Console.WriteLine();
                // Serve to connect to...
                string ServerName = "LocalHost";
                // Define the path to the metabase
                string MetabasePath = "IIS://" + ServerName + "/W3SVC/1/ROOT";
                try
                {
                    // Talk to the IIS Metabase to read the MimeMap Metabase key
                    DirectoryEntry Entry = new DirectoryEntry(MetabasePath);
                    // Get the Mime Types as a collection
                    PropertyValueCollection pvc = Entry.Properties["HTTPExpires"];
                    string HttpExpires = pvc.Value.ToString();
                    if (HttpExpires.Length == 0)
                    {
                        Console.WriteLine("HttpExpires is not enabled!");
                    }
                    else
                    {
                        char HttpExpiresType = HttpExpires[0];
                        switch (HttpExpiresType) { case 'D':
                                string Seconds = HttpExpires.Substring(3);
                                if (Seconds == "0")
                                    Seconds = "Immediately";
                                else if (Seconds.StartsWith("0x")==true)
                                    Seconds = "in " + int.Parse(HttpExpires.Substring(5),
                                        System.Globalization.NumberStyles.HexNumber).ToString() + " Seconds";
                                else
                                    Seconds = "in " + Seconds + " Seconds";
                                Console.WriteLine("HttpExpires {0}", Seconds);
                                break;
                            case 'S':
                                Console.WriteLine("HttpExpires {0}", HttpExpires.Substring(2));
                                break;
                            default:
                                Console.WriteLine("Unknown HttpExpires Type : {0}", HttpExpiresType);
                                break;
                        }
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Failed to read HttpExpires property with the following exception: \n{0}",
                        ex.Message);
                }
                finally
                {
                    Console.Read();
                }
            }
        }
    }


    c# - How to display the IP Address, TCP/IP Port, and Host Header values from IIS
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.DirectoryServices;
    namespace EnumSites
    {
        class Program
        {
            static void Main(string[] args)
            {
                DirectoryEntry entry = new DirectoryEntry("IIS://localhost/w3svc/1");
                PropertyValueCollection pvc = entry.Properties["ServerBindings"];
                foreach (object value in pvc)
                {
                    // Format is IPAddress:Port:HostHeader
                    string[] Bits = value.ToString().Split(':');
                    string IPAddress = Bits[0];
                    string TCPIPPort = Bits[1];
                    string HostHeader = Bits[2];
                    Console.WriteLine("IP = {0}, Port = {1}, Header = {2}", 
                        (IPAddress.Length == 0) ? "(All Unassigned)" : IPAddress, 
                        TCPIPPort, 
                        (HostHeader.Length == 0) ? "(No Host Header)" : HostHeader);
                }
                Console.Read();
            }
        }
    }
    

    This simple code will allow you to display the IP Address, TCP/IP Port, and Host Header values for the default web site. The default web site has an Instance ID of 1.

    If you want to display for a different web site then change the "IIS://localhost/w3svc/1" to another instance. You can determine the instance ID from the log file name in the log entry properties dialog in the IIS manager.

     


    Christchurch .NET Users Group Meeting - June 21st, 2006

    I had the pleasure to present to the Christchurch .NET Users Group ( http://www.dot.net.nz ) last evening. It was a very cold night with hail, sleet, rain and we had around 25 people attend.

    I spoke about three topics in my presentation:

    IIS Scripting

    In the talk on IIS Scripting I discussed the different providers that were available to manage IIS from a command line script or application. These include ADSI and WMI, Admin Base Objects and the new IIS 7 Managed Provider.

    References:

    IIS Diagnostic Tools

    In the discussion about IIS diagnostic tools I presented details on the following tools from the Debug Diagnostic Toolkit for IIS.

    Authentication and Access Control Diagnostics

    Authentication and Access Control Diagnostics (Authdiag) Version 1.0 allows you to review, test, and correct problems with Internet Information Services (IIS) authentication and authorization. You can use Authdiag to check settings on Web sites, FTP sites, virtual directories, Web directories, and files. Authdiag can help you troubleshoot the following types of issues:

    SSL Diagnostics

    It provides a centralized location to display all relevant SSL configuration information. Most of this information is stored in the metabase, which is the main IIS configuration file. Information related to certificates is also stored in the Windows registry.

    SSL Diagnostics checks for the correct configuration of SSL objects and settings. These include client and server certificates, ports, private keys, and Web site states.

    Administrators can test whether their current server certificate is working properly by temporarily replacing the current certificate with a self-signed certificate. Administrators are able to test their certificates with a single click of the mouse.

    Administrators can use SSL Diagnostics to quickly simulate the connection, or handshake, between the server and browser, and review the response from the server. This is very helpful for determining where in the SSL handshake process the connection is breaking down.

    Debug Diagnostics

    Debug Diagnostics (DebugDiag) 1.0 is a comprehensive tool designed to help IIS administrators or developers determine why a IIS worker process is crashing, hanging, or memory leak. It offers a simple User Interface to build rules for capturing these common problems with web applications and also offers a built-in analysis system

    References:

    IIS7

    In the IIS 7 section of the presentation I discussed some of the benefits of the new server and its new modular architecture, new UI, new extensibility, and diagnostics functionality.

    I showed a number of demos of IIS 7 including a custom Basic Authentication module, a custom Directory Browsing Module, Tracing Features, Debugging a crashing application pool with Debug Diag and some features of the new User Interface.

    References


    My presentation was made on the Beta 2 build of Vista Ultimate and most of the tools worked fine on Vista and IIS 7 even though they are not designed to. As far as I know no body left early - a good sign.... IIS can be a dry topic to developers but I hope they learned something useful about the new product and of course scripting and diagnostics that they may not have known previously.


    IIS Insider - June 2006 - Written by me....

    I have had my first set of questions & answers on the Microsoft FTP Server published in June IIS Insider section on www.microsoft.com

    IIS Insider is a monthly column designed to answer your questions on how to troubleshoot and make the most of Microsoft Internet Information Services (IIS).

    IIS Insider

    The questions I presented are:

    • Adding Virtual Directories to an FTP Server
    • Administering Physical Directories on an FTP Site
    • User Isolation Mode options

    The article is up for the month of June (it only went up today June 22) at http://www.microsoft.com/technet/community/columns/insider/default.mspx

    After June you can see the details on the IIS Insider column archives


    Ripcord software has released IISxpress for IIS 5, 5.1 and 6.0 ( that is 2k, XP, and 2k3)

    IISxpress is a compression engine for IIS 5.0/5.1/6.0. Based on the ZLIB compression library IISxpress is a high performance, stable, scalable compression extension to IIS. Version 2.0 introduces native 64bit support, new configuration wizards, significant performance improvements (over 100% in some cases) and a new Community Edition which is free for non-commercial, non-governmental use.

    IISxpress uses an opt-out rule model to simplify configuration - all content is compressed unless configured otherwise. IISxpress is pre-configured with a suitable set of default rules when first installed, you are free to add and remove rules as you see fit. IISxpress supports rules based on the extension of the file requested, the MIME (content type) type of the response, the path of the request (URI) or the source IP address of the client.

    IISxpress allows you to track compression effectiveness at the server level right down to each individual request allowing you to fine tune your server's performance for real world loading.

    Key features

    • User friendly interface
    • Highly configurable
    • Real time compression performance monitoring
    • NEW in 2.0: Helpful context sensitive wizards
    • NEW in 2.0: 64bit and multi-core support
    • NEW in 2.0: Community Edition version – free for non-commercial, non-governmental use.
    • Scalable – CPU and memory load sensitive
    • Supports ASP, ASP.NET, etc.

     

    Benefits

    • Faster content delivery
    • Improved site responsiveness
    • Less server bandwidth usage
    • 100% client browser and search bot compatibility

     

    Audience

    • Internet Web Site Administrators
    • Intranet Web Site Administrators
    • Web Site Developers

     

    Supported Platforms

    • Windows 2003: All server versions, 32 and 64 bit
    • Windows 2000: Professional and all sever versions
    • Windows XP Professional: 32 and 64 bit

    See http://www.ripcordsoftware.com/IISxpress/default.aspx for more details


    Windows Vista Beta 2 - You can now download without a MSDN Subscription!!!

    Microsoft have not by the looks of things released the Beta 2 version of Windows Vista to the general public.

    This Beta 2 release is now available in three languages (English, German, and Japanese) and in 32-bit and 64-bit editions.

    When you register for the Customer Preview Program you will receive the Beta 2 release plus Windows Vista Release Candidate 1 (RC1) — the next major pre-release of Windows Vista — when it is available later this year. The information on this page pertains to both Beta 2 and RC1.

    The Customer Preview Program is available in a limited quantity both through download and DVD kit ordering. Once the allotted quantity has been reached the program will be closed and no new orders will be accepted.

    There are two ways to get Windows Vista Beta 2:

    1. Order the DVD kit and have it shipped to your home or office.
    2. Download the ISO file to your PC
      (An ISO file is an exact representation of a CD or DVD, including the content and the logical format. Once you download the ISO file, you’ll need to burn it to a DVD before you can install the software.)

    http://www.microsoft.com/windowsvista/getready/preview.mspx

    Note: If you install into a Virtual Environment then get ready for very poor performace. You are better to install onto a real PC - performance is about 50 times better compared to the virtual environment.


    Webcast: Exploring the Future of Web Development and Management with Internet Information Services (IIS) 7.0
    Bill Staples, Product Unit Manager on the IIS team, will be hosting an upcoming TechNet Webcast titled Exploring the Future of Web Development and Management with Internet Information Services (IIS) 7.0.  Join the WebCast and see cool IIS 7.0 demos for many of the new features.

    Date/Time: 6/20/2006 1:00 PM Pacific
    Duration: 90 minutes
    Attendee Registration URL: http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032299053&Culture=en-US

    FTP - Steve Schofield has written a couple of useful articles on Blind Drop & Blind Get FTP Server using IIS

    Steve Schofield has written two artricles on how to setup an anonymous “blind drop” and “Blind Get“ FTP server using Microsoft Windows 2003

    See these articles

    You maybe wondering, what is a “blind drop” server?  A “blind drop” FTP server provides individuals or companies a method to anonymously transfer files using FTP files without having permission to list files or retrieve files on the FTP site.  In other words, you can “drop” files onto the server but not see what’s there or retrieve files if you did know what was there. There are benefits for both the end-user and FTP administrator.  The end-user doesn’t have to remember a user id and password.  The FTP administrator uses NTFS permissions so anonymous users can’t browse or retrieve files.  The biggest benefit for the FTP administrator is that they don’t have to maintain user ids and passwords for everyone needing FTP access. 

    You maybe wondering, what is a “blind get” server?  A “blind get” FTP server provides a method to anonymously transfer files using FTP without having permission to list files or add files on the FTP site.  In other words, you can “get” files but not see what’s there or retrieve files unless the absolute path is known.  There are benefits for both the end-user and FTP administrator.  The end-user doesn’t have to remember a user id and password.  The FTP administrator uses NTFS permissions so anonymous users can’t browse or add files. 


    A better registration script for the Atlas Framework for a production server

    The following script (taken from http://geekswithblogs.net/colinbo) ( and modified a bit by me ) shows how you can configure your production web sites to support the Atlas Framework.

    The original registration script for the http handler only registers the script on the first site (site ID 1 - Default Web Site) where as this script will register it on all sites that do not contain it.

    The original script from http://geekswithblogs.net/colinbo also had problems in that:

    1. It did not take any note as to the version of .NET runtime running on the web site!
    2. The original code could not handle an application pool with no Applications assigned to it.

    I have fixed them in the following code:

    Source Code

    Option Explicit
    Dim WMIService, ApplicationPool, ApplicationPools, Applications, index, VirtualDirectorySettings
    Dim ApplicationName, ScriptMap, FoundMapping, ScriptMapCollection, LastPosition, FrameworkVersion 
    Const ComputerName = "localhost"
    Const ScriptMapExtension = ".asbx"
    Const ScriptMapEntry = ".asbx,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST"
    Set WMIService = GetObject("winmgmts:{authenticationLevel=pktPrivacy}\\" + ComputerName + "\root\microsoftiisv2")
    Set ApplicationPools = WMIService.ExecQuery("Select * From IIsApplicationPool Where Name LIKE 'W3SVC/AppPools/%'")
    For Each ApplicationPool in ApplicationPools
        WScript.Echo "Inspecting Application Pool " + ApplicationPool.Name
        ApplicationPool.EnumAppsInPool Applications
     if (UBound(Applications) > 0) then
         For index = lbound(Applications) to UBound(Applications)
          ApplicationName = CleanApplicationName(Applications(index))
       WScript.echo "Inspecting " +ApplicationName
             Set VirtualDirectorySettings = GetObject( "IIS://" + ComputerName + "/" + ApplicationName)
     
          If Err.number = 0 Then 
              ScriptMapCollection = VirtualDirectorySettings.ScriptMaps 
              FoundMapping = False
        FrameworkVersion  = False
           For Each ScriptMap in ScriptMapCollection      
         if (instr(ScriptMap, "v2.0.50727") <> -1) then FrameworkVersion = true
                  If LCase(Left(ScriptMap, Len(ScriptMapExtension))) = ScriptMapExtension then 
                      WScript.Echo ApplicationName + " - Updating (Previous: " + ScriptMap + ")"
                   ScriptMap = ScriptMapEntry
                FoundMapping = True
             Exit For
                     End IF
                 Next
        If FoundMapping = False and (FrameworkVersion = true) Then
         WScript.Echo "Did not find mapping in " + ApplicationName
         LastPosition = UBound(ScriptMapCollection) + 1
         Redim Preserve ScriptMapCollection(LastPosition)
         WScript.Echo ApplicationName + " - Adding " + ScriptMapExtension
         ScriptMapCollection(LastPosition) = ScriptMapEntry
        End If
        VirtualDirectorySettings.ScriptMaps = ScriptMapCollection
        VirtualDirectorySettings.SetInfo
             Else
              WScript.Echo ApplicationName & " - Unable to locate application virtual directory."
             End If
      Next
     end if
        WScript.Echo 
    Next
    ' Trims the leading /LM/ and trailing /
    Function CleanApplicationName(applicationName)
        Dim ReturnValue
        If Len(applicationName) < 5 Then
            WScript.Echo "applicationName should be greater than 5 characters: " + applicationName
            Exit Function
        End If
        ReturnValue = Mid(applicationName, 5)
        ReturnValue = Mid(ReturnValue, 1, Len(ReturnValue) - 1)
        CleanApplicationName = ReturnValue
    End Function
    

    For more sample code like this visit : http://geekswithblogs.net/colinbo


    Mix 06 - All 52 sessions are online and free!
    Back a few months ago Microsoft went to Las Vegas to put on a share called Mix06. If you do business on the Web today, it's likely that more than 90% of your customers reach you via Microsoft® Internet Explorer and/or Microsoft Windows®. Come to MIX and learn how the next versions of these products, due later this year, are going to dramatically improve your customers' experience. Explore a wide range of new Web technologies that Microsoft is delivering to help you unlock new revenue opportunities and lower development costs. Learn about the future of Internet Explorer and join us in a discussion about how we can build the ideal Web surfing platform to meet your needs and those of your customers.
    • Be the first to get the latest preview build of IE7
    • Work with the members of the Internet Explorer team in the Compatibility Lab to get your site ready for IE7
    • Test drive "Atlas," Microsoft's powerful new framework for building cross–browser, cross–platform AJAX applications
    • Explore Windows Live!, Microsoft's new consumer services strategy
    • Learn how to deliver revolutionary, media–rich Web content with the new Windows Presentation Foundation
    • Find out how to extend your content, media and services into the living room with Windows Media Center and Xbox 360™
    • More than 50 separate sessions and discussions for Web developers, designers and business professionals

    All 52 sessions are now online and free

    http://mix06.com/Default.aspx


    IIS 7 - Extensibility - How to extend the IIS system to add copyright to image requests and more

    A new article up on www.iis.net has been published that shows just how far you can configure the new IIS 7 web server. The article is all about Extensibility, and is an end-to-end example of how to extend the IIS 7 web server with a custom request handler. It will show how to add API and command-line support for the configuration of this handler and how to write a User interface module that can plug into the IIS Management Interface.

    Feature Set:

    • Managed handler inserts a copyright message into image files that are requested
    • Copyright message feature is configuration driven and uses the new IIS7 configuration system 
    • Configuration can be schematized and made accessible to configuration API’s, WMI scripting and IIS command-line tools 
    • User Interface Extension Module allows configuration of copyright message feature through the IIS7 User Interface

    Wow this is really a full article on how to extend IIS...

    The article is quite long in fact it is over 12 on www.iis.net so the print preview option is a better way to view and follow the article http://www.iis.net/1076/SinglePageArticle.ashx

     


    C# - How to display MimeMap entries to the console from an instance of IIS

     The following c# application will return all of the MimeMaps defined in an IIS instance. The MimeMaps hold the mime types that IIS uses to return the ContentType header.

    An example of such a header is application/octetstream

    This example requires a reference to the Active DS IIS Namespace Provider in Visual Studio .NET. This reference enables you to use the IISOle namespace to access the IISMimeType class.

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Collections.Specialized;
    using System.DirectoryServices;
    using System.Collections;
    namespace IISMIMEType
    {
        class Program
        {
            static void Main(string[] args)
            {
                // Maintain a sorted list to contain the MIME Types
                SortedList sl = new SortedList();
                Console.WriteLine("IIS Mime Map - c#");
                Console.WriteLine();
                // Serve to connect to...
                string ServerName = "LocalHost";
                // Define the path to the metabase
                string MetabasePath = "IIS://" + ServerName + "/MimeMap";
                // Note: This could also be something like
                // string MetabasePath = "IIS://" + ServerName + "/w3svc/1/root";
                try
                {
                    // Talk to the IIS Metabase to read the MimeMap Metabase key
                    DirectoryEntry MimeMap = new DirectoryEntry(MetabasePath);
                    // Get the Mime Types as a collection
                    PropertyValueCollection pvc = MimeMap.Properties["MimeMap"];
                    // Add each Mime Type so we can display it sorted later
                    foreach (object Value in pvc)
                    {
                        // Convert to an IISOle.MimeMap - Requires a connection to IISOle
                        // IISOle can be added to the references section in VS.NET by selecting
                        // Add Reference, selecting the COM Tab, and then finding the 
                        // Active DS Namespace provider
                        IISOle.MimeMap mimetypeObj = (IISOle.MimeMap)Value;
                        // Add the mime extension and type to our sorted list.
                        sl.Add(mimetypeObj.Extension, mimetypeObj.MimeType);
                    }
                    // Render the sorted MIME entries
                    if (sl.Count == 0)
                        Console.WriteLine("No MimeMap entries are defined at {0}!", MetabasePath);
                    else
                        foreach (string Key in sl.Keys)
                            Console.WriteLine("{0} : {1}", Key.PadRight(20), sl[Key]);
                }
                catch (Exception ex)
                {
                    if ("HRESULT 0x80005006" == ex.Message)
                        Console.WriteLine(" Property MimeMap does not exist at {0}", MetabasePath);
                    else
                        Console.WriteLine("An exception has occurred: \n{0}", ex.Message);
                }
            }
        }
    }
        


    Example Output

    .*  application/octet-stream
    .323  text/h323
    .acx  application/internet-property-stream
    .ai  application/postscript
    .aif  audio/x-aiff
    .aifc  audio/aiff
    .aiff  audio/aiff
    .application  application/x-ms-application
    .asf  video/x-ms-asf
    .asr  video/x-ms-asf
    .asx  video/x-ms-asf
    .au  audio/basic
    .avi  video/x-msvideo
    .axs  application/olescript
    .bas  text/plain
    .bcpio  application/x-bcpio
    .bin  application/octet-stream
    .bmp  image/bmp
    .c  text/plain
    .cat  application/vndms-pkiseccat
    .cdf  application/x-cdf
    .cer  application/x-x509-ca-cert
    .clp  application/x-msclip
    .cmx  image/x-cmx
    .cod  image/cis-cod
    .cpio  application/x-cpio
    .crd  application/x-mscardfile
    .crl  application/pkix-crl
    .crt  application/x-x509-ca-cert
    .csh  application/x-csh
    .css  text/css
    .dcr  application/x-director
    .deploy  application/octet-stream
    .der  application/x-x509-ca-cert
    .dib  image/bmp
    .dir  application/x-director
    .disco  text/xml
    .dll  application/x-msdownload
    .doc  application/msword
    .dot  application/msword
    .dvi  application/x-dvi
    .dxr  application/x-director
    .eml  message/rfc822
    .eps  application/postscript
    .etx  text/x-setext
    .evy  application/envoy
    .exe  application/octet-stream
    .fif  application/fractals
    .flr  x-world/x-vrml
    .gif  image/gif
    .gtar  application/x-gtar
    .gz  application/x-gzip
    .h  text/plain
    .hdf  application/x-hdf
    .hlp  application/winhlp
    .hqx  application/mac-binhex40
    .hta  application/hta
    .htc  text/x-component
    .htm  text/html
    .html  text/html
    .htt  text/webviewhtml
    .ico  image/x-icon
    .ief  image/ief
    .iii  application/x-iphone
    .ins  application/x-internet-signup
    .isp  application/x-internet-signup
    .IVF  video/x-ivf
    .jfif  image/pjpeg
    .jpe  image/jpeg
    .jpeg  image/jpeg
    .jpg  image/jpeg
    .js  application/x-javascript
    .latex  application/x-latex
    .lsf  video/x-la-asf
    .lsx  video/x-la-asf
    .m13  application/x-msmediaview
    .m14  application/x-msmediaview
    .m1v  video/mpeg
    .m3u  audio/x-mpegurl
    .man  application/x-troff-man
    .manifest  application/x-ms-manifest
    .mdb  application/x-msaccess
    .me  application/x-troff-me
    .mht  message/rfc822
    .mhtml  message/rfc822
    .mid  audio/mid
    .mmf  application/x-smaf
    .mny  application/x-msmoney
    .mov  video/quicktime
    .movie  video/x-sgi-movie
    .mp2  video/mpeg
    .mp3  audio/mpeg
    .mpa  video/mpeg
    .mpe  video/mpeg
    .mpeg  video/mpeg
    .mpg  video/mpeg
    .mpp  application/vnd.ms-project
    .mpv2  video/mpeg
    .ms  application/x-troff-ms
    .mvb  application/x-msmediaview
    .nc  application/x-netcdf
    .nws  message/rfc822
    .oda  application/oda
    .ods  application/oleobject
    .p10  application/pkcs10
    .p12  application/x-pkcs12
    .p7b  application/x-pkcs7-certificates
    .p7c  application/pkcs7-mime
    .p7m  application/pkcs7-mime
    .p7r  application/x-pkcs7-certreqresp
    .p7s  application/pkcs7-signature
    .pbm  image/x-portable-bitmap
    .pdf  application/pdf
    .pfx  application/x-pkcs12
    .pgm  image/x-portable-graymap
    .pko  application/vndms-pkipko
    .pma  application/x-perfmon
    .pmc  application/x-perfmon
    .pml  application/x-perfmon
    .pmr  application/x-perfmon
    .pmw  application/x-perfmon
    .png  image/png
    .pnm  image/x-portable-anymap
    .pnz  image/png
    .pot  application/vnd.ms-powerpoint
    .ppm  image/x-portable-pixmap
    .pps  application/vnd.ms-powerpoint
    .ppt  application/vnd.ms-powerpoint
    .prf  application/pics-rules
    .ps  application/postscript
    .pub  application/x-mspublisher
    .qt  video/quicktime
    .ra  audio/x-pn-realaudio
    .ram  audio/x-pn-realaudio
    .ras  image/x-cmu-raster
    .rgb  image/x-rgb
    .rmi  audio/mid
    .roff  application/x-troff
    .rtf  application/rtf
    .rtx  text/richtext
    .scd  application/x-msschedule
    .sct  text/scriptlet
    .setpay  application/set-payment-initiation
    .setreg  application/set-registration-initiation
    .sh  application/x-sh
    .shar  application/x-shar
    .sit  application/x-stuffit
    .smd  audio/x-smd
    .smx  audio/x-smd
    .smz  audio/x-smd
    .snd  audio/basic
    .spc  application/x-pkcs7-certificates
    .spl  application/futuresplash
    .src  application/x-wais-source
    .sst  application/vndms-pkicertstore
    .stl  application/vndms-pkistl
    .stm  text/html
    .sv4cpio  application/x-sv4cpio
    .sv4crc  application/x-sv4crc
    .t  application/x-troff
    .tar  application/x-tar
    .tcl  application/x-tcl
    .tex  application/x-tex
    .texi  application/x-texinfo
    .texinfo  application/x-texinfo
    .tgz  application/x-compressed
    .tif  image/tiff
    .tiff  image/tiff
    .tr  application/x-troff
    .trm  application/x-msterminal
    .tsv  text/tab-separated-values
    .txt  text/plain
    .uls  text/iuls
    .ustar  application/x-ustar
    .vcf  text/x-vcard
    .wav  audio/wav
    .wbmp  image/vnd.wap.wbmp
    .wcm  application/vnd.ms-works
    .wdb  application/vnd.ms-works
    .wks  application/vnd.ms-works
    .wmf  application/x-msmetafile
    .wps  application/vnd.ms-works
    .wri  application/x-mswrite
    .wrl  x-world/x-vrml
    .wrz  x-world/x-vrml
    .wsdl  text/xml
    .xaf  x-world/x-vrml
    .xbm  image/x-xbitmap
    .xla  application/vnd.ms-excel
    .xlc  application/vnd.ms-excel
    .xlm  application/vnd.ms-excel
    .xls  application/vnd.ms-excel
    .xlt  application/vnd.ms-excel
    .xlw  application/vnd.ms-excel
    .xml  text/xml
    .xof  x-world/x-vrml
    .xpm  image/x-xpixmap
    .xsd  text/xml
    .xsl  text/xml
    .xwd  image/x-xwindowdump
    .z  application/x-compress
    .zip  application/x-zip-compressed
     

    For more details on MimeMaps see:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/b9b7a30c-5d24-4310-bb70-398c3129f6b3.asp

    For more details on using System.DirectoryServices to configure IIS see:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/d39fae66-abe7-4902-a3fc-f36151561f01.asp?frame=true


    Windows XP IIS Manager v1.7 aka Easy IIS

    Windows XP IIS Manager v1.7 aka EasyIIS

    I keep forgetting to blog about this tool which is up on www.codeproject.com - this tool includes source in C++ and the binary files as well.

    Why do you want it?

    Well basically IIS on Windows 2000 Professional or Windows XP Professional will only allow you to create one web site. This can be a problem when developing code for multiple web sites (not such an issue with ASP.NET v2 with the build in Development Web Server but still an issue).

    So IIS will only allow the Default Web Site via the UI, but you have always been able to create new web sites using ADSI or WMI so why do you need it?

    Simple - it makes life easy...

    Limitations

    Like most of the limitation in IIS on Windows XP you can't get get around them. Althgouh you can create multuple sites you can only have one of them active at a time. This means that you can still only really work on the one project at once.

    Also there may be issues with the creation of Application Root's based on some of the comments but in general a very useful tool.

    You can download this tool and its source code from http://www.codeproject.com/w2k/EasyIIS.asp


    C# - How to display almost all properties for all IIS Virtual Web Servers

    Source Code

    Note: You will need to add a reference to System.DirectoryServices if you are using VisualStudio.net

    using System;
    using System.DirectoryServices;
    namespace IISSample
    {
        static class Program
        {
            /// 
            /// The main entry point for the application.
            /// 
            [STAThread]
            static void Main()
            {
                const string WebServerSchema = "IIsWebServer"; // Case Sensitive
                string ServerName = "LocalHost";
                DirectoryEntry W3SVC = new DirectoryEntry("IIS://" + ServerName + "/w3svc");
                foreach (DirectoryEntry Site in W3SVC.Children)
                {
                    if (Site.SchemaClassName == WebServerSchema)
                    {
                        Console.WriteLine("WebSite Instance ID : " +Site.Name);
                        foreach (string PropertyName in Site.Properties.PropertyNames)
                        {
                            Console.WriteLine(PropertyName);
                            PropertyValueCollection pvc = Site.Properties[PropertyName];
                            foreach(object Value in pvc)
                                Console.WriteLine("  " + Value.ToString());
                        }
                    }
                    Console.WriteLine("".PadRight(80, '-'));
                }
            }
        }
    }

    Example Output:

    ServerSize
      1
    NotDeletable
      True
    FrontPageWeb
      True
    ServerAutoStart
      True
    ServerState
      2
    ServerComment
      Default Web Site
    KeyType
      IIsWebServer
    DefaultDoc
      Default.htm,Default.asp,index.htm,iisstart.asp
    SecureBindings
      :443:
    ServerBindings
      :80:
      :9090:chris
    CPUResetInterval
      1440
    CPULoggingInterval
      60
    CPULoggingOptions
      1
    CPULoggingMask
      255
    CPUCGIEnabled
      True
    CPUAppEnabled
      True
    AnonymousPasswordSync
      True
    LogType
      1
    LogFilePeriod
      1
    LogFileTruncateSize
      20971520
    LogExtFileFlags
      1414
    DirBrowseFlags
      1073741886
    CacheISAPI
      True
    AllowKeepAlive
      True
    CGITimeout
      300
    ConnectionTimeout
      900
    MaxConnections
      10
    ContentIndexed
      True
    PasswordChangeFlags
      6
    AspLogErrorRequests
      True
    AspScriptFileCacheSize
      250
    AspScriptEngineCacheMax
      125
    AspExceptionCatchEnable
      True
    AspTrackThreadingModel
      False
    AspAllowOutOfProcComponents
      True
    AspEnableAspHtmlFallback
      False
    AspEnableChunkedEncoding
      True
    AspEnableTypelibCache
      True
    AspErrorsToNTLog
      False
    AspProcessorThreadMax
      25
    AspRequestQueueMax
      3000
    AspThreadGateEnabled
      False
    AspThreadGateTimeSlice
      1000
    AspThreadGateSleepDelay
      100
    AspThreadGateSleepMax
      50
    AspThreadGateLoadLow
      50
    AspThreadGateLoadHigh
      80
    AspMaxDiskTemplateCacheFiles
      1000
    AspAllowSessionState
      True
    AspBufferingOn
      True
    AspEnableParentPaths
      True
    AspSessionTimeout
      20
    AspQueueTimeout
      -1
    AspCodepage
      0
    AspScriptTimeout
      90
    AspScriptErrorSentToBrowser
      True
    AppAllowDebugging
      False
    AppAllowClientDebug
      False
    AspKeepSessionIDSecure
      False
    AspBufferingLimit
      134217728
    AspEnableApplicationRestart
      True
    AspQueueConnectionTestTime
      3
    AspSessionMax
      -1
    AspLCID
      2048
    AspMaxRequestEntityAllowed
      1073741824
    AuthFlags
      5
    AnonymousUserName
      IUSR_CCROWE
    AnonymousUserPass
      O0vqT^=Vz:2\9&
    NTAuthenticationProviders
      Negotiate,NTLM
    LogPluginClsid
      {FF160663-DE82-11CF-BC0A-00AA006111E0}
    Realm
      ap.trimblecorp.net
    AspScriptLanguage
      VBScript
    AspScriptErrorMessage
      An error occurred on the server when processing the URL.  Please contact the system administrator.
    AdminACL
      System.__ComObject
    LogFileDirectory
      C:\WINDOWS\system32\LogFiles
    AspDiskTemplateCacheDirectory
      %windir%\system32\inetsrv\ASP Compiled Templates
    HttpErrors
      400,*,FILE,C:\WINDOWS\help\iisHelp\common\400.htm
      401,1,FILE,C:\WINDOWS\help\iisHelp\common\401-1.htm
      401,2,FILE,C:\WINDOWS\help\iisHelp\common\401-2.htm
      401,3,FILE,C:\WINDOWS\help\iisHelp\common\401-3.htm
      401,4,FILE,C:\WINDOWS\help\iisHelp\common\401-4.htm
      401,5,FILE,C:\WINDOWS\help\iisHelp\common\401-5.htm
      403,1,FILE,C:\WINDOWS\help\iisHelp\common\403-1.htm
      403,2,FILE,C:\WINDOWS\help\iisHelp\common\403-2.htm
      403,3,FILE,C:\WINDOWS\help\iisHelp\common\403-3.htm
      403,4,FILE,C:\WINDOWS\help\iisHelp\common\403-4.htm
      403,5,FILE,C:\WINDOWS\help\iisHelp\common\403-5.htm
      403,6,FILE,C:\WINDOWS\help\iisHelp\common\403-6.htm
      403,7,FILE,C:\WINDOWS\help\iisHelp\common\403-7.htm
      403,8,FILE,C:\WINDOWS\help\iisHelp\common\403-8.htm
      403,9,FILE,C:\WINDOWS\help\iisHelp\common\403-9.htm
      403,10,FILE,C:\WINDOWS\help\iisHelp\common\403-10.htm
      403,11,FILE,C:\WINDOWS\help\iisHelp\common\403-11.htm
      403,12,FILE,C:\WINDOWS\help\iisHelp\common\403-12.htm
      403,13,FILE,C:\WINDOWS\help\iisHelp\common\403-13.htm
      403,15,FILE,C:\WINDOWS\help\iisHelp\common\403-15.htm
      403,16,FILE,C:\WINDOWS\help\iisHelp\common\403-16.htm
      403,17,FILE,C:\WINDOWS\help\iisHelp\common\403-17.htm
      404,*,FILE,C:\WINDOWS\help\iisHelp\common\404b.htm
      405,*,FILE,C:\WINDOWS\help\iisHelp\common\405.htm
      406,*,FILE,C:\WINDOWS\help\iisHelp\common\406.htm
      407,*,FILE,C:\WINDOWS\help\iisHelp\common\407.htm
      412,*,FILE,C:\WINDOWS\help\iisHelp\common\412.htm
      414,*,FILE,C:\WINDOWS\help\iisHelp\common\414.htm
      500,12,FILE,C:\WINDOWS\help\iisHelp\common\500-12.htm
      500,13,FILE,C:\WINDOWS\help\iisHelp\common\500-13.htm
      500,15,FILE,C:\WINDOWS\help\iisHelp\common\500-15.htm
    ScriptMaps
      .asp,C:\WINDOWS\system32\inetsrv\asp.dll,5,GET,HEAD,POST,TRACE
      .cer,C:\WINDOWS\system32\inetsrv\asp.dll,5,GET,HEAD,POST,TRACE
      .cdx,C:\WINDOWS\system32\inetsrv\asp.dll,5,GET,HEAD,POST,TRACE
      .asa,C:\WINDOWS\system32\inetsrv\asp.dll,5,GET,HEAD,POST,TRACE
      .idc,C:\WINDOWS\system32\inetsrv\httpodbc.dll,5,OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE
      .shtm,C:\WINDOWS\system32\inetsrv\ssinc.dll,5,GET,POST
      .shtml,C:\WINDOWS\system32\inetsrv\ssinc.dll,5,GET,POST
      .stm,C:\WINDOWS\system32\inetsrv\ssinc.dll,5,GET,POST
      .asax,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .ascx,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .ashx,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
      .asmx,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
      .aspx,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
      .axd,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
      .vsdisco,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
      .rem,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
      .soap,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
      .config,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .cs,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .csproj,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .vb,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .vbproj,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .webinfo,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .licx,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .resx,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .resources,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .master,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .skin,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .compiled,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .browser,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .mdb,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .jsl,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .vjsproj,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .sitemap,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .msgx,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
      .ad,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .dd,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .ldd,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .sd,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .cd,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .adprototype,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .lddprototype,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .sdm,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .sdmDocument,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .ldb,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .svc,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,1,GET,HEAD,POST,DEBUG
      .mdf,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .ldf,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .java,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .exclude,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
      .refresh,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,5,GET,HEAD,POST,DEBUG
    HttpCustomHeaders
      X-Powered-By: ASP.NET
    MaxBandwidth
      -1

    You can also do this for all of the IIS Classes such as:

    IIsCertMapper Maps certificates to Windows accounts.
    IIsCompressionSchemes Global settings for HTTP 1.1 compression schemes.
    IIsCompressionScheme Settings for individual compression schemes.
    IIsComputer Establishes global settings for IIS configuration.
    IIsCustomLogModule Sets properties for custom logging information field nodes.
    IIsFilter Provides information about a specific filter.
    IIsFilters Manages filters.
    IIsFtpInfo Establishes configuration properties for FTP servers in addition to those set at IIsFtpService.
    IIsFtpServer Establishes configuration properties for a single FTP server.
    IIsFtpService Establishes configuration properties common to all FTP servers.
    IIsFtpVirtualDir Sets properties for an individual FTP virtual directory.
    IIsIPSecurity A custom ADSI object you can use to set access permissions by IP address and domain address.
    IIsLogModule Contains information about a specific logging module.
    IIsLogModules Maintains information about installed logging modules.
    IIsMimeMap Manages Multipurpose Internet Mail Extension (MIME) mappings.
    IIsMimeType Used to manipulate the list of valid MIME types.
    IIsWebDirectory Sets properties for an individual Web directory.
    IIsWebFile Sets properties for an individual Web file.
    IIsWebInfo Establishes configuration properties for Web servers in addition to those set at IIsWebService.
    IIsWebServer Establishes configuration properties for a single Web server.
    IIsWebService Establishes configuration properties common to all Web servers.
    IIsWebVirtualDir Sets properties for an individual Web virtual directory.

    Note: Note all classes are available at all levels in the IIS Metabase Hierarchy - so you can not for example get an IIsVirtualDirectory at the same level as the IIsWebServer because it is a child element of an IIsWebServer

    For more details see the following references


    Reinstalling IIS on an Exchange 2000 or Exchange 2003 server

    If you are running IIS on an Exchange Server 2000 or 2003 machine make sure you really think hard before you uninstall IIS - it is not a trivial process to get your exchange and IIS linked together again.

    Microsoft has a KB article #320202 available here http://support.microsoft.com/default.aspx?scid=kb;en-us;320202 that describes the process in detail to get the system working again.

    Apparently when you remove IIS you have also removed some additional configuration parameters that exchange has added to the IIS Metabase and you must follow the 6 steps below to relink the attributes when you install IIS again.

    • Back Up Data
    • Dismount the Mailbox and the Public Information Store
    • Stop Exchange Services and Remove IIS
    • Reinstall Internet Information Service and Reapply Service Packs
    • Reinstall Exchange Server
    • Restore the Original Exchange Information Store

    So this is a non trivial action - just make sure you really know what you are doing prior to removing IIS and if you are going to remove IIS and follow the KB Article give yourself plenty of time...


    Creating a virtual directory using System.EnterpriseServices and C#
    I came across this post in the IIS Newsgroups today


    I want to create virtual directory in IIS. I have a method in doing C# for doing this . The following code is supposed do my job. But It throws the following errors. I strongly feel there is something going wrong with the metabase path "IIS://localhost/W3SVC/1/Root".

    Can somebody help me in finding out correct metabase path.

    //Create a virtual directory

    System.EnterpriseServices.Internal.IISVirtualRoot vr = new System.EnterpriseServices.Internal.IISVirtualRoot();

    string sError;

    vr.Create("IIS://localhost/W3SVC/1/Root",@"C:\Demos\WebServices\","WebServices",out sError);

    The error it has thrown is :

    System.Runtime.InteropServices.COMException (0x80070003): The system cannot find the path specified
    at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
    at System.DirectoryServices.DirectoryEntry.Bind()
    at System.DirectoryServices.DirectoryEntry.get_IsContainer()
    at System.DirectoryServices.DirectoryEntries.CheckIsContainer()
    at System.DirectoryServices.DirectoryEntries.Add(String name, String schemaClassName)
    at System.EnterpriseServices.Internal.IISVirtualRoot.Create(String RootWeb, String inPhysicalDirectory, String VirtualDirectory, String Error)
     

    In my search to try to help this person I came across the original location of the code he used at
    http://blogs.officezealot.com/charles/archive/2004/10/26/3191.aspx

    I never know that there was a System.EnterpriseServices.Internal.IISVirtualRoot object in .NET so I learned something along the way as well.

    Note: If testing this you will need to add a reference to System.EnterpriseServices

    I did some simple tests to try to reproduce the error that the user has seen. I managed to get the same error by specifying an invalid metabase path which explains the The system cannot find the path specified message.

    In the code above the IIS Metabase path is specified as /W3SVC/1/Root. The digit 1 (one) in the code refers to the Web Site with an Instance ID of 1. This is always the default web site.

    The way to determine what your web site instance id is; is to look at the log file name.

    The Log filename contains a path such as W3SVCx where x is the web site Instance ID.

    Open IIS Manager and select the web site.

    Right click it and select properties and the following will be displayed.

    Click on the properties button to bring up the Extended logging properties dialog.

    In the highlighted area in the image above you will see the web site Instance ID.

    Replace the number in the code with this number and it should work fine for you.


    Microsoft Virtual Labs

    These labs give you time as a full admin using a product on an OS fully configured for a period of 90 minutes in your web browser. You can do what you want including trashing the system completely. This is your time to try the product. Do you have the system at home or work to install these products? who carees, try the labs you can really put the product though its paces.

    IIS 7.0 Virtual Labs

    SQL Server 2005 Virtual Labs

    + heaps of others on Security, Sharepoint, MOM, Windows Server, ISA, SMS, Live Communication Server.... 

    http://www.microsoft.com/technet/traincert/virtuallab/default.mspx


    The new official IIS 7 Site is now publically available and online

    http://www.iis.net

    IIS 7 Virtual Labs

    Do you want to play around with the latest verison of IIS 7 without having to find a machine or a setup a Virtual PC image?

    The new IIS 7 site has Virtual Labs where can test IIS 7 today on Vista Beta 2 (offical release version) via a web browser for 90 minutes for free.

    The virtual labs have a workbook you can download for showing you parts of the new system; one of the labs shows how to create a new Authentication module for IIS 7 so you can use any ASP.NET membership provider as the credential store for Basic Authentication.

    http://staginglabs.iis.net/

    TechCENTER

    Now you can find all Microsoft IIS technical information in a single location.

    The TechCenter has a nice search interface where you can search for content based on a large number of different criteria as shown below.

    You can also browse the TechCENTER using a number of different categories such as:

    • IIS 7
    • Administration & Management
    • ASP.NET Administration
    • Extensibility
    • Publishing Content
    • Security
    • Setuyp & Migration
    • Troubleshooting
    • Tuning IIS
    • Updates
    • WebFarms

    http://www.iis.net/default.aspx?tabid=2

    Downloads

    A number of IIS related tools for downloads are also available in a number of categories:

    • Montioring Tools
    • IIS 7 Tools
    • Team Favorites
    • Security Tools
    • Debugging Tools
    • Administration Tools

    http://www.iis.net/default.aspx?tabid=3

    Forums

    Obviously an offical site dedicated to IIS must have a communtity forum where you should get the best support available for current versions of IIS and also the next version.

    If you have joined the ASP.NET forums then you will already be a member of the IIS forums.

    Expect to see answers by Microsoft exmployees and also MVP's and lots of others willing to help you with your questions and problems.

    http://forums.iis.net/

    Blogs

    Just like everywhere else there are blogs on the new offical IIS 7 site - currently they only appear to havge the IIS team blogs and not any of the MVP blogs such as this one. I do not know if that will change but I don't mind either way but it would help with supporting others who have prompted and support their products.

    http://blogs.iis.net/

    IIS Web Cast Series

    Just incase you are looking for WebCasts on IIS there is a nice section that displays them all.

    http://www.iis.net/default.aspx?tabid=2&subtabid=24


    Hint: You can also just play around with Vista in the Virtual Labs if you wanted as well since it is a full version of Vista.

    Remember the URL is www.iis.net - nice and simple to remember - so go check it out...


    Windows PowerShell - WMI and IIS

    A simple example to return all the fields in the IISWebService object on an IIS 6 computer using Windows PowerShell and the get-wmiobject cmdlet.

    A simple example to return just the name fields from the IISWebServer object on an IIS 6 computer.

     


    The .NET Show: IIS 7.0

    Shipping with Windows Vista will be the latest version of Internet Information Services (IIS), which includes a broad collection of features and capabilities that have been anxiously awaited by both developers and IT Pros. Scott Guthrie and Bill Staples describe and demo new features in IIS 7.0

    This is a 1 hour 30 minute show (with 30 minutes) covering IIS 7 which was recorded on May 18th, 2006.

    The technical level is 300 so we should see some good techy stuff in the video and not just marketing fluff.

    The technoBabble section is the section on IIS 7.

    For more details and to watch the video

    http://msdn.microsoft.com/theshow/episode.aspx?xml=theshow/en/episode056/manifest.xml


    Mitch Tulloch interviews IIS evangelist Brett Hill

    Mitch Tulloch is the author of Windows 2000 Administration in a Nutshell, Windows Server 2003 in a Nutshell, and Windows Server Hacks.

    Mitch intervies Brett Hill about the forthcoming IIS 7 product line that will be included with Windows Vista and Windows Server (“LongHorn“)

    For the full article see http://www.windowsdevcenter.com/lpt/a/6594


    IIS 7 - New Site dedicated to IIS 7

    Microsoft will be launching a new web site dedicated to IIS 7 on Tuesday 23rd May 2006 (note currently password protected) to coincide with the impending release of Windows Vista & Windows Server ("Longhorn") Beta 2. 

    Some of the features of the new site:

    • The first true detailed learning on IIS 7.0 (40+ articles, videos, etc.)
    • IIS Product Team blogs
    • Community focused Forums similar to ASP.NET & MSDN
    • Learning Portal called "TechCENTER"
    • Real-live Virtual Labs so you can practice IIS 7.0 at your pace, online, without ever installing bits

    Some of the features of the new IIS 7 product:

    • Minimize patching and security risks with fine grained control over Web server footprint
    • Implement powerful Web solutions rapidly with a new extensibility framework
    • Go to market faster with simplified deployment and configuration of applications
    • Reduce administrative costs by managing Web infrastructure more efficiently
    • Reduce Web site downtime by quickly resolving faulty applications

    The site url is www.iis.net  (remember not until Tuesday 23rd May 2006)


    Locating Unused Log File Directories

    When running IIS on a server edition you can create multiple web sites and over time you may add and remove sites. When you do this the Log Files are still retained

    The following script can be used to find unused log file directories that are no longer associated with any IIS Web Sites - it does not delete them just displays them.

    Example Output

    Usage

    • cscript LocateUnusedLogFileDirectories.VBS

    Source Code

    You can download the source code by clicking here.

    Option Explicit
    
    dim LogFileDirectory
    dim Folders()
    dim Sites()
    dim Valid()
    
    function EnumerateFolders()
     Dim FSO, Dir, File, Index
    
     set FSO = createobject("Scripting.FileSystemObject")
     set Dir = fso.GetFolder(LogFileDirectory)
    
     redim Folders(Dir.SubFolders.Count)
     redim Valid(Dir.SubFolders.Count)
    
     Index =0
    
     for each File in Dir.SubFolders
      if (left(File.Name,5) = "W3SVC") then
       Folders(Index) = File.Name
       Valid(Index) = false
       Index = Index+1
      end if
     next
    
     redim Preserve Folders(Index-1)
     redim Preserve Valid(Index-1)
    
     set Dir = Nothing
     set FSO = Nothing
    end function
    
    function DisplayFolders()
     dim Folder, Index, Bad
    
     Bad = 0
     for Index= 0 to UBound(Folders)
      if (Valid(Index) = false) then
       Bad = Bad + 1
       WScript.echo LogFileDirectory & "\" & Folders(Index)
      end if
     next
     if (Bad = 0) then
      WScript.echo "There are no Log directories found that are not associated with IIS"
     else
      WScript.echo ""
      WScript.echo Bad & " directories were found..."
     end if
    end function
    
    function EnumerateSites()
     Dim IISObj, Web, Index
    
     Index = 0 
     Set IISOBJ = getObject("IIS://localhost/w3svc")
     for each Web in IISOBJ
      if (Web.Class = "IIsWebServer") then 
        Index = Index + 1
        redim Preserve Sites(Index)
        Sites(Index) = "W3SVC" & Web.Name 
      end if
     next
     Set IISOBj=Nothing
    end function
    
    Function ProcessFolders()
     dim Folder, Index, fIndex
    
     for Index = 0 to UBound(Sites) 
      for fIndex= 0 to UBound(Folders) 
       if (Sites(Index) = Folders(fIndex)) then
        Valid(fIndex) = true
       end if
      next
     next
    end Function
    
    function GetDefaultLogFolderPath
     Dim IISObj
    
     Set IISOBJ = getObject("IIS://localhost/w3svc")
     LogFileDirectory =  IISObj.LogFileDirectory
     Set IISOBj = Nothing
    end function
    
    function WriteHeader
     WScript.Echo "The following directories are no longer associated with any IIS Web Sites."
     WScript.Echo ""
    end function
    
    call WriteHeader
    call GetDefaultLogFolderPath
    call EnumerateFolders
    call EnumerateSites
    call ProcessFolders
    call DisplayFolders

    IIS 6 - Web Site Instance IDs - seemingly random but they are not!

    On IIS 6.0 you will find that when you create web sites that their log files are created with seemingly random numbers. In previous versions of IIS the Instance IDs as they are called were sequentially numbered.

    The first "Default Web Site" has a log file directory of W3SVC1 but any new sites you create may end up as follows (or something similar)

    • W3SVC1240841244
    • W3SVC1289352529
    • W3SVC147076792
    • W3SVC1527186048
    • W3SVC1566259604
    • W3SVC1710104836

    I have written a script that you can use to display all the web sites and their associated Instance Ids - the output similar to the following.

    Web Sites                    Description
    ===============================================================
    W3SVC/1                   Default Web Site
    W3SVC/1036328378 WebSite1
    W3SVC/1816184000 WebSite2
    W3SVC/1867813904 WebSite3
    W3SVC/568530179   WebSite4
    W3SVC/719499532   WebSite5
    W3SVC/669732006   WebSite6

    See http://blog.crowe.co.nz/archive/2005/12/08/346.aspx for the script.

    Something I only learned recently was that the Instance Ids can be made sequential again by editing the registry and they are not random at all.

    Changing the behaviour to the same as previous IIS versions

    Remember : Editing the registry is a risk you take on your own shoulders.

    To do this:

    1. Click Start, click Run. In the Open box, type regedit, and then click OK.
    2. In Registry Editor, locate the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetMgr\Parameters
    3. Click the Parameters key. On the Edit menu, click New Dword Value.
    4. Type IncrementalSiteIDCreation for the name.
    5. Double-click the name of the new value.
    6. Change Value Data to 1, and then click OK.
    7. To enable the change, restart the IIS services.

    Note: When you remotely administer another IIS server, the value of the registry key of the local server is used to determine how the site identification number is generated on the remote server.

    Why was it changed?

    The reason that Instance ID were changed was that if you are running a Web Farm with multiple physical IIS servers and create a web site on each server with the same description all of the web sites will have the same Instance ID.

    Basically if you create a new web site in IIS 6 and then delete the web site and create it again it will be created with the same Instance ID. So if you have multiple physical web servers for a particular web application you can read the log files from the same W3SVCx where x is the instance ID.

    I created a web site with a description of XYZ and it produced the Instance ID of 906768 so my log file directory ended up as W3SVC906768

    I then deleted this web site and the associated Log File Directory and repeated the exercise.

    It indeed did create the same Instance ID of 90768

    The following table shows some descriptions and Instance IDs

    Description Instance ID Comment
    A 66 ASCII character for B not A
    B 67 ASCII character for C not B
    AA 6631 No idea why 31 appears
    AB 6632 No idea why 32 appears
    AAA 669696 No idea why 96 appears

     


    Update for HTTP Issues for Microsoft® Internet Security and Acceleration (ISA) Server 2004 Standard Edition with Service Pack 2 (KB 916106)
    This update addresses the following HTTP issues for ISA Server 2004 Standard and Enterprise Editions with Service Pack 2 (SP2):

    • KB 915045: Error 502 "The HTTP request includes a non-supported Header" when accessing certain web servers. This occurs when accessing certain Web servers that return headers that are incompatible with each other.

    • KB 915421: Errors 11001 or 400 when accessing certain web servers. This is caused by a misinterpretation of spaces in headers provided by ISA Server, and results in a corrupted URL and failure to load the Web page.

    • KB 915422: Event ID 23004 when accessing web sites that respond with compressed content. Some Web servers always return compressed content, which is denied by ISA Server when it did not request compressed content.

    • KB 916573: Error 500 (Internal Server Error. Not implemented (-2147467263)) when trying to download zip attachments from an Outlook Web Access server. The header returned by Outlook Web Access causes ISA Server to deny the response.

    • KB 917134: Grayed out checkbox “Enable caching of content received through the BITS service”
     

    Cool new IIS7 Features and APIs

    IIS7 is a major upgrade of IIS, and will ship in both Windows Vista as well as Windows Longhorn Server.  It includes a ton of new functionality, including some very rich integration with ASP.NET.  This includes:

    1) The ability to now have HttpModules and HttpHandlers participate in all requests to a server.  You no longer need to map requests to the ASP.NET ISAPI in order to write managed modules that participate in requests.  This makes building modules for flexible authentication, authorization, logging, url-rewriting, auditing, etc. super easy with .NET.  You could even now have an ASP.NET HttpModule provide forms-authentication to a PHP or JSP page (in addition to .htm files and static files like images and movies).

    2) Integration of the ASP.NET configuration system with IIS.  IIS now uses the same web.config configuration model as ASP.NET, which means you can have both ASP.NET and IIS configuration settings in the same file together.  You can now set things like default pages, IIS security, logging, etc within a web.config file and xcopy/ftp it to a server.  This should simplify deployment and installation of applications considerably.  It also enables "delegated administration" for hosting scenarios -- where a hoster provides the application developer the ability to configure certain settings in their web.config file without requiring full admin privledges.

    3) An integrated Admin UI tool that manages both IIS and ASP.NET settings together.  Included within this rich GUI is support for things like the Membership, Roles and Profile providers (so you can create/delete users directly within the GUI tool -- regardless of what provider is configured).  The admin tool also supports remote delegated admin over http -- which means you can point the rich-client admin tool at a shared hoster server and manage your users/roles/profile settings remotely over http (which is pretty cool).

    4) Much better request auditing and error debugging.  We have a new feature we call "Failed Request Event Buffering" (affectionately known as "FREB"), which allows administrators to configure applications to automatically save request information anytime an error occurs during a request, or if a request takes longer than a specified amount of time to complete (note: if the request completes ok this information can then be just thrown away -- and so doesn't fill up your disk log).  This allows you to easily go in after the fact and see what exactly happened during a request that failed, as well as analyze any error exceptions.  This can even capture tracing messages generated within ASP.NET or within any component or class library that uses System.Diagnostics -- which makes it much easier for developers and admins to instrument and analyze what is going on with systems at runtimes.

    5) Much better configuration APIs and command-line tools.  In addition to new config and admin APIs (including a nifty one that you can use to get a listing of all "active" requests being processed by the server -- as well as what state they are in), we now have a great command-line admin story that you can use to set/modify/retrieve all configuration information as well as manage the server (start/stop individual apps, lookup their health state, register new apps, refresh SSL certs, etc).  The command-line tool and APIs are also extensible, so you can plug in your own providers and extensions to them.

    http://weblogs.asp.net/scottgu/archive/2006/04/20/443513.aspx

     


    ClustrMaps - Show a map of where you get your web site visitors....

    I came across an interesting site today http://clustrmaps.com

    See at a glance where your site's visitors are located: instantaneously, even when the numbers are enormous! Visitors don't need to click on anything: just viewing your page is sufficient.

    One thumbnail map on your site shows it all: We provide (free) the HTML that gives you a thumbnail map, like the one on the left. When it loads, it increments a counter and shows the locations of all the visitors to your page, cumulatively (even for huge numbers). Clicking on it zooms in to a big world map, and (optionally) lets you zoom in to the continents, as in the example below.

    No hidden extras: For light users (under 2500 visitors daily - that is me) the service is free, forever, and stores cumulative totals up to many hundreds of thousands of visitors. Paying users get extra features.


    How to enumerate the Windows NT Services and if they are running from an ASP script.

    The following ASP script will allow you to view all services on a particular computer and their current state (Started, Stopped, Starting, Stopping etc)

    Important

    By default you will not be able to run the script because the IUSR_ computer account does not have the correct permissions to perform this action.

    If you do try to run this script with the standard IUSR_ account you will get the following error.

    HTTP 500.100 - Internal Server Error - ASP error
    Internet Information Services


    Technical Information (for support personnel)

    • Error Type:
      (0x80041003)
      /service/Default.asp, line 4
       
    • Page:
      GET /service/Default.asp

     

    Line 4 was this line in the source file: set objService = GetObject("winmgmts:")

    The way I worked around this was to create a new local account on the IIS server (in my case Windows XP) called "MyASPService". I gave this account no special permissions or anything else just created the new account.

    You then create a new directory in your web site called "MyServices" or what ever name you want.

    In the Internet Information Server manager you then configure this directory by changing the default anonymous user account from the IUSR_ account to your new "MyASPService" account as shown below.

    When you now request the page in the browser it will now use the new MyASPService account and it will work.

    Example Outputt

    The Dhcp service is Running
    Service Name Service Caption Service State
    Adobe LM Service Adobe LM Service Stopped
    Alerter Alerter Stopped
    ALG Application Layer Gateway Service Running
    AppMgmt Application Management Stopped
    aspnet_state ASP.NET State Service Stopped
    AudioSrv Windows Audio Running
    BITS Background Intelligent Transfer Service Stopped
    Browser Computer Browser Running
    CacheMgr Sophos Cache Manager Running
    CiSvc Indexing Service Stopped
    ClipSrv ClipBook Stopped
    clr_optimization_v2.0.50215_32 .NET Runtime Optimization Service v2.0.50215_X86 Stopped
    clr_optimization_v2.0.50727_32 .NET Runtime Optimization Service v2.0.50727_X86 Stopped
    COMSysApp COM+ System Application Running
    <%
    set objService = GetObject("winmgmts:")

    ' To query a specific service
    servicename = "Dhcp"
    set service = objService.Get("Win32_Service.Name='" & servicename & "'")
    Response.Write "The " & ServiceName & " service is " & service.state & "
    "


    ' To enumerate all services
    Response.Write ""
    Response.Write""
    Response.Write""
    Response.Write""
    Response.Write""
    Response.Write""
    foreachServiceinobjService.InstancesOf("Win32_Service")
    Response.Write""
    Response.Write""
    Response.Write""
    Response.Write""
    Response.Write""
    Next
    Response.Write"
    Service Name Service Caption Service State
    " & service.name & " " & service.Caption & " " & service.state & "
    "

    %><html>
    <body>
    <%
    set objService = GetObject("winmgmts:")

    ' To query a specific service
    servicename = "Dhcp"
    set service = objService.Get("Win32_Service.Name='" & servicename & "'")
    Response.Write "The " & ServiceName & " service is " & service.state & "<hr>"

    ' To enumerate all services
    Response.Write "<table>"
    Response.Write "<TR>"
    Response.Write "<TH>Service Name</TH>"
    Response.Write "<TH>Service Caption</TH>"
    Response.Write "<TH>Service State</TH>"
    Response.Write "</TR>"
    for each Service in objService.InstancesOf("Win32_Service")
      Response.Write "<TR>"
      Response.Write "<TD>" & service.name & "</TD>"
      Response.Write "<TD>" & service.Caption & "</TD>"
      Response.Write "<TD>" & service.state & "</TD>"
      Response.Write "</TR>"
    Next
    Response.Write "</table>"

    %>
    </body>
    </html>

    Simple VB Script to show the authentication methods enabled for directories in a web site.

    The following script will allow you to process all physcial and virtual directories for a particular web site and show what authentication methods are enabled.

    Each directory will have one or more of the following to determine the authentication methods enabled.

    • A = Anonymous
    • B = Basic
    • D = Digest
    • N = NTLM
    • S = SSL
    • S128 = SSL 128 Bit

    You must specify the web site instance id when calling the script. In the case of Windows XP Pro there is (by default) only one web site which has an instance ID of 1. If you are running multiple web sites on a Server OS or you have created multiple web sites on XP pro then you can find the web site instance ID by the following method.

    • Right click the web site, select properties, on the web site tab under logging click the Properties button, part of the log file name will contain the web site #

      example log filename: W3SVC1\exyymmdd.log  - the web site is 1
                                       W3SVC45\exyymmdd.log - the web site is 45

    Calling Usage:   cscript EnumAuthenticationMethods.vbs  InstanceID

    Example Output

    You can download the source for this script here (just rename to .VBS from the .TXT file that it is now)

    function EnumVirtualDirectories(LevelMachineNameObjectPathDirStyle)
      Dim ChildObjectIISObkect

      on error resume next
      Err.Clear

      IIsObjectPath = "IIS://" & MachineName
      If (ObjectPath = ""Then
        exit function
      else
        IIsObjectPath = IIsObjectPath & "/" & ObjectPath
      End If

      'WScript.Echo "Checking : " & IISObjectPath

      Set IIsObject = GetObject(IIsObjectPath)

      If (Err.Number <> 0Then
        if (Level = 1then
          WScript.Echo "Error: " & Err.Description & " (" & Err.Number & ")"
        end if
        exit function
      End If

      Err.Clear

      For Each ChildObject In IIsObject
        If (Err.Number <> 0Then
          '    WScript.Echo "Error = " & Err.Description
          '      Exit For
        end if

        if (ChildObject.Class = DirStylethen
          ChildObjectName = Right(ChildObject.AdsPathLen(ChildObject.AdsPath- 6)
          ChildObjectName = Right(ChildObjectNameLen(ChildObjectName- InStr(ChildObjectName"/") )

          if (len(ChildObjectName< 60then
            ChildObjectName = ChildObjectName & space(60-len(childObjectName))
          end if

          Annonymous  = " "
          Basic    = " "
          Digest    = " "
          NTLM    = " "
          SSL      = " "
          SSL128    = " "

          if (ChildObject.AuthAnonymousthen Annonymous = "A"
          if (ChildObject.AuthBasicthen Basic = "B"
          if (ChildObject.AuthDigestthen Digest = "D"
          if (ChildObject.AuthNTLMthen NTLM = "N"

          if (ChildObject.AccessSSLthen SSL = "S"
          if (ChildObject.AccessSSL128then SSL128 = "128"

          WScript.Echo ChildObjectName & " " & Annonymous & " " & Basic & " " & Digest & " " & _
              NTLM & " " & SSL & SSL128

          EnumVirtualDirectories Level+1MachineName,  ChildObjectNameDirStyle
        end if
      next

    End Function

    Sub DisplayHelpMessage()
      WScript.Echo
      WScript.Echo "Usage:"
      WScript.Echo "      EnumAuthenticationMethods.VBS WebSiteNumber"
      WScript.Echo
      WScript.Echo "WebSiteNumber is the number of the web site, you have two methods to determine this:"
      WScript.Echo
      WScript.Echo "#1 = Run FINDWEB.VBS"
      WScript.Echo "#2 = Right click the web site, select properties, on the web site tab"
      WScript.Echo "     under logging click the Properties button, part of the log file"
      WScript.Echo "     name will contain the web site #"
      WScript.Echo
      WScript.Echo "     example log filename: W3SVC1\exyymmdd.log  - the web site is 1"
      WScript.Echo "                           W3SVC45\exyymmdd.log - the web site is 45"
    end sub

    Const GENERAL_FAILURE = 2

    ' Get the Arguments object
    Set ArgObj = WScript.Arguments

    ' Test to make sure there is at least one command line arg - the command
    If ArgObj.Count < 1 Then
      DisplayHelpMessage
      WScript.Quit (GENERAL_FAILURE)
    End If

    Servername = "LocalHost"
    WebSiteID    = ArgObj(0)
    WebSite        = "W3SVC/" & WebSiteID & "/Root"
    Level             = 1

    WScript.Echo "Authentication Methods:"
    WScript.Echo "    A=Anonymous, B=Basic, D=Digest, N=NTLM, S=SSL, S128=SSL 128bit"
    WScript.Echo ""
    WScript.Echo "Virtual Directories for " & WebSite
    EnumVirtualDirectories LevelServerNameWebSite"IIsWebVirtualDir"

    WScript.Echo ""
    WScript.Echo "Physical Directories for " & WebSite
    EnumVirtualDirectories LevelServerNameWebSite"IIsWebDirectory"


    Simple VB Script to show what directories allow anonymous access or not for a web site.

    I saw a request on the Microsoft.Public.InetServer.IIS newsgroup today and so I modified a prevously written script I wrote on www.iisfaq.com to do the task.

    Question

    • I'm running an IIS 5.1 web server at home (Windows XP Pro), and what I was hoping to do is list all of the directories for a web site which have anonymous access disabled

    Answer

    The following script will allow you to process all physcial and virtual directories for a particular web site and show if they allow anonymous access or not.

    You must specify the web site instance id.

    In the case of Windows XP Pro there is (by default) only one web site which has an instance ID of 1.

    If you are running multiple web sites on a Server OS or you have created multiple web sites on XP pro then you can find the web site instance ID by the following method.

    • Right click the web site, select properties, on the web site tab under logging click the Properties button, part of the log file name will contain the web site #

      example log filename: W3SVC1\exyymmdd.log  - the web site is 1
                                       W3SVC45\exyymmdd.log - the web site is 45

    Calling Usage:   cscript EnumAnonymousAccessDiabled.vbs  InstanceID

    Example Output

    You can download the source for this script here (just rename to .VBS from the .TXT file that it is now)

    function EnumVirtualDirectories(LevelMachineNameObjectPathDirStyle)
      Dim ChildObjectIISObkect

      on error resume next
      Err.Clear

      IIsObjectPath = "IIS://" & MachineName
      If (ObjectPath = ""Then
        exit function
      else
        IIsObjectPath = IIsObjectPath & "/" & ObjectPath
      End If

      'WScript.Echo "Checking : " & IISObjectPath

      Set IIsObject = GetObject(IIsObjectPath)

      If (Err.Number <> 0Then
        if (Level = 1then
          WScript.Echo "Error: " & Err.Description & " (" & Err.Number & ")"
        end if
        exit function
      End If

      Err.Clear

      For Each ChildObject In IIsObject
        If (Err.Number <> 0Then
          '    WScript.Echo "Error = " & Err.Description
          '      Exit For
        end if

        if (ChildObject.Class = DirStylethen
          ChildObjectName = Right(ChildObject.AdsPathLen(ChildObject.AdsPath- 6)
          ChildObjectName = Right(ChildObjectNameLen(ChildObjectName- InStr(ChildObjectName"/") )

          if (len(ChildObjectName< 60then
            ChildObjectName = ChildObjectName & space(60-len(childObjectName))
          end if
          WScript.Echo ChildObjectName & " - " & ChildObject.AuthAnonymous

          EnumVirtualDirectories Level+1MachineName,  ChildObjectNameDirStyle
        end if
      next

    End Function

    Sub DisplayHelpMessage()
      WScript.Echo
      WScript.Echo "Usage:"
      WScript.Echo "      EnumAnonymousAccessDisabled.VBS WebSiteNumber"
      WScript.Echo
      WScript.Echo "WebSiteNumber is the number of the web site, you have two methods to determine this:"
      WScript.Echo
      WScript.Echo "#1 = Run FINDWEB.VBS"
      WScript.Echo "#2 = Right click the web site, select properties, on the web site tab"
      WScript.Echo "     under logging click the Properties button, part of the log file"
      WScript.Echo "     name will contain the web site #"
      WScript.Echo
      WScript.Echo "     example log filename: W3SVC1\exyymmdd.log  - the web site is 1"
      WScript.Echo "                           W3SVC45\exyymmdd.log - the web site is 45"
    end sub

    Const GENERAL_FAILURE = 2

    ' Get the Arguments object
    Set ArgObj = WScript.Arguments

    ' Test to make sure there is at least one command line arg - the command
    If ArgObj.Count < 1 Then
      DisplayHelpMessage
      WScript.Quit (GENERAL_FAILURE)
    End If

    Servername = "LocalHost"
    WebSiteID    = ArgObj(0)
    WebSite        = "W3SVC/" & WebSiteID & "/Root"
    Level             = 1

    WScript.Echo "Allow Anonymous Access"
    WScript.Echo ""
    WScript.Echo "Virtual Directories for " & WebSite
    EnumVirtualDirectories LevelServerNameWebSite"IIsWebVirtualDir"

    WScript.Echo ""
    WScript.Echo "Physical Directories for " & WebSite
    EnumVirtualDirectories LevelServerNameWebSite"IIsWebDirectory"

    IIS Directory Browsing

    IIS supports a directory browsing mode where you can view a list of files and directories instead of viewing an HTML page.

    This is very useful for example when you have a lot of files and folders such as an MP3 collection.

    To enable this mode you select either a Physical or Virtual directory in the Internet Information Services application and select properties and then select the Directory Browsing check box as shown below.

    Once you enable this option when you browse to the directory or any child directories they will be shown using the built in directory browsing module.

    In the above view there is a single file and a single directory displayed, and they map to the following physical directory which is the home directory for the web site; in this case c:\inetpub\websites\directorybrowsing

    Hiding Files

    If you have some files in your directory that you do not want the user to see you must mark them as Hidden using the Windows Explorer file properties dialog.

    Note: If you mark the file as hidden even if you know the name of the file you can not download the file (an HTTP 404 error will be produced)

    Why do my Virtual Directories not show up in the browse list?

    In the example above we have a virtual directory called Music which is pointing to e:\music (directory browsing has been enabled for the Web Site Root and also for the Music Virtual directory)

    When you browse the web site you do not see the Music Virtual directory.

    This is a special case where IIS does not show the virtual directory but if you knew the name of the virtual directory and manually entered it into the address bar you would see the files as shown below.

    The way to make sure your users can see the virtual directory while they are browsing the root is to create a physical directory with the same name in the physical folder of the parent directory.

    So in our case our parent directory points to c:\inetpub\websites\directorybrowsing so we must create a folder called Music in the c:\inetpub\websites\DirectoryBrowsing folder.

    Nothing has to exist in this new empty Music directory and as soon as you create the folder and refresh the listing you will see the directory shown in the web browser and you have the ability to navigate into it as we would any other directory.

    Applying your own style to the directory listing

    You can't.....


    ISAPI Filter - LeechBlocker by Michael R. Brumm

    LeechBlocker is an open source ISAPI Filter for Microsoft's Internet Information Services

    The filter intercepts all incoming requests and checks to see if the resource (an image for example) is being referred to by the same site by which it is being hosted. If the referrer is not the same as the site name, the filter checks to see if the extension of the resource requested is an image (.gif, .jpg, .jpeg, etc...). If the extension indicates that the resource is an image, then the request is denied.

    You can download the DLL and/or the full source code in C++ for the ISAPI filter

    http://www.michaelbrumm.com/leechblocker.html


    IIS Applications - don't remove it from the Root of your web site....

    IIS Applications

    An IIS application is any file that is executed within a defined set of directories in your Web site. When you create an application, you use the Internet Information Services snap-in to designate the application's starting-point directory (also called an application root) in your Web site. Every file and directory under the starting-point directory in your Web site is considered part of the application until another starting-point directory is found. You thus use directory boundaries to define the scope of an application.

    If you remove the IIS Application from the web site properties dialog you will find that you can not connect to your web site at all and you will not get any errors and trying to identify the problem could be quite difficult.

    Using a packet sniffer I received the following information when I made a request to my web site:

     

    If you open IE 6 and enter the URL the following will be displayed.

     

    If you then click refresh IE just sits there in an endless loop....

    Errors

    • Nothing is logged in the Web Site Log file
    • Nothing is logged in the Event Log
    • Nothing is logged in the HTTPERR log file

    Obviously the fix is to recreate the IIS Application by simply clicking on the Create button on the Home Directory tab. 

    As soon as you do this your web site will work again, but this could be something that could catch someone out.

    An interesting side affect of this is if you then create a virtual directory (make sure the IIS Application is created for the Virtual Directory, but not the root) you can access the virtual directory but not the root of the site. Is this security by obsecurity?


    IIS 6 - Downloads being terminated by HTTP.SYS

    At work we came across a situation on a Windows 2003 Server IIS 6 machine where people downloading one specific file were finding that it was being terminated during the transfer. Those people who had file download managers or web browsers with resume did not notice the problem but Internet Explorer would just terminate the download.

    • This Windows 2003 Server machine did not have Service Pack 1 installed
    • The particular download was approx 20MB.

    This machine was located in the United States and users in the United States did not notice and could not reproduce the problem.

    In the httperr.log file in c:\windows\system32\logfiles\HTTPERR we would find entries like the following

    date time c-ip s-ip c-port cs-version cs-method cs-uri sc-status s-siteid s-reason
    2006-02-22 5:52:53     80 HTTP/1.1 GET - DataTransfer120/DataTransfer120.exe - 19499532 Timer_MinBytesPerSecond

    The reason given for the termination of the download was Timer_MinBytesPerSecond which Microsoft states as the following

    • The connection expired because the client was not receiving a response at a reasonable speed.
    • The response send rate was slower than the default of 240 bytes/sec.

    The strange thing was we were getting around 30KB/S and then the download would terminate so we were getting a faster response than 240 bytes per second.

    The fix

    The fix to the problem was to install Service Pack 1 for Windows 2003 Server. I received a response from a Microsoft employee that stated "There are many bugs in http.sys timeout logic fixed in SP1 - one bug regarding send-size being more than 15270*MinBytesPerSecond - this was not released as a qfe, your only option is to upgrade to SP1."

    Installing Service Pack 1 has indeed cured this problem....

    Additional References


    FTP User Editor for Active Directory (Updated)

    The FTP User Editor for Microsoft Active Directory has been updated a fix a couple of problems.

    Bugs

    • There was a limit of 1000 objects being returned from the Active Directory - increased to 32768. 

    You can download and install from:

    For more details on the FTP User Editor please see the original post at http://blog.crowe.co.nz/archive/2006/02/15/556.aspx


    Internet Information Services (IIS) 6.0 Manager for Windows XP (not saving added servers)

    Overview

    With IIS 6.0 Manager for Windows XP, administrators can remotely manage an IIS 6.0 server from a Windows XP Professional workstation. This tool only installs a snap-in for Microsoft Management Console and its associated DLLs and documentation; it does not install the complete IIS 6.0 server on your local computer.
     
    • This tool is available only in English. When installed on non-English editions of Windows XP, IIS 6.0 Manager, documentation, folders, and shortcuts appear as English-only.
       
    • After installation, IIS 6.0 Manager and IIS 5.1 Manager coexist in separate directories on the same computer.

       
    • Start the IIS 6.0 Manager after installation from the administrative tools folder in the Control Panel, not from the Computer Management console. If the IIS 5.1 Manager is also installed, it will appear in the Computer Management console, not the IIS 6.0 Manager.

    Download

    http://www.microsoft.com/downloads/details.aspx?FamilyID=F9C1FB79-C903-4842-9F6C-9DB93643FDB7&displaylang=en

    Problems

    In general the IIS 6 Manager for XP works well but you will find that every time you open it it shows you your local XP's IIS configuration and if you have added an IIS 6 Server and then closed the Manager your settings are lost when you reload.

    The way around this problem is to perform the following:

    • Select Start-Run
    • Enter "MMC" and hit Enter
    • Click the "File" menu and select "Add/Remove Snap-in"
    • Click the "Add" button
    • Scroll down the list and select "Internet Information Services (IIS6) Manager" and click Add
    • Click Close
    • Click OK
    • Right click on "Internet Information Services (IIS6) Manager" under the Console Root node and select "Connect"
    • Enter the name of your IIS6 machine (use "Connect as" if needed)
    • Select "File - Save As..." and browse to "c:\document and settings\All Users\Start Menu\Programs\Administrative Tools"
    • Enter "Internet Information Services (MINE)" and click Save
    • Click File - Exit

    Now you should find the new menu item "Internet Information Services (MINE)" under Administrative Tools.

    When you load it you will find that it contains the local machine and the remote machine's details that you added.

    You can keep adding other machines to this configuration - just remember to click File-Save and you settings will be saved.


    FTP User Editor for Microsoft Active Directory (Updated)

    The FTP User Editor for Microsoft Active Directory has been updated a fix a couple of problems.

    Bugs

    • The connect dialog did not hide the password as you typed it!
    • The Recent Users were lost after you shutdown due to a difference in implementation between the old and new controls.

    New Features

    • You can now browse to find the path for the FTP Root directory.

    You can download and install from:

    For more details on the FTP User Editor please see the original post at http://blog.crowe.co.nz/archive/2006/02/15/556.aspx


    COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.

    If you add a reference to Microsoft Excel and then try to use it within your ASP.NET application you may receive the following error.

    Server Error in '/excel' Application.


    Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.

    Example Application

    The problem is that by default Microsoft Excel as a COM object can only activated by the following accounts:

    • Administrator
    • System
    • Interactive

    When you are running your ASP.Net account on Windows XP your web application is running as the ASPNET account.

    The way to resolve this issue is to edit the DCOM configuration settings for the Microsoft Excel Application object.

    Configure DCOM

    • Go to the Start-Run menu item.
    • Type in "DCOMCNFG" and hit enter.
    • This should load the "Component Services" MMC (you can also load from Administrative Tools - Component Services"
    • Expand "Component Services"
    • Expand "Computers"
    • Expand "My Computer"
    • Select the "DCOM Config" item
    • Select the "Microsoft Excel Application" item.
    • Right click and select Properties
    • Select the Security Tab and you should see the following:



       
    • Under "Launch and Activation Permissions" select the "Customize" option.
    • Click the "Edit" button

      Windows XP

               

      Windows 2003 Server

       

        
       
    • Click the "Add" button to add a new account to the list.
    • On the dialog that is displayed click the Locations button

      (this is because by default your domain will be selected and we need a local account)

      In this dialog scroll the list to the top (sometimes the first item is not visible) but scroll to the top and select the first item which is your computer name. In the list below "CCROWE" is the name of my computer.



       
    • Click the OK button
    • On the dialog that is displayed enter "ASPNET" as the account name (make sure location is set to the name of the computer that IIS is on) on Windows XP or if you are running on Windows 2003 Server you must enter the account that the Application Pool is running as, by default "Network Service"

      Windows XP

                    

      Windows 2003 Server

      Note: A quicker way on Windows XP is to just enter the computer name and the account
      so in my case that would be:

                ccrowe\ASPNET 

       


    • Click the OK button
    • Now make sure you select the following options for the "ASP.NET Machine Account" or the account that is the application pool identity ( by default Network Service)
       
      • Local Launch         : Allow
      • Remote Launch        : [blank]
      • Local Activation     : Allow
      • Remote Activation    : [blank]

      These settings can be seen below:

    •  

      Windows XP

               

      Windows 2003 Server

       
    • Click the OK button and test your web application again and it should work fine.

    Note: Remember if you are running on Windows 2003 Server you must use the application pool identity as the account and not the ASPNET account.

     


    FTP User Account Editor for Active Directory

    FTP User Editor for Microsoft Active Directory.....

    What is this?

    When you run the FTP server with Microsoft IIS 6.0 on the Windows 2003 Server Family of products you can have the FTP server isolate users to their own folders. This means that the user can not browse into another users folder.

    There are three isolation modes:

    1. Do not isolate users
    2. Isolate Users
    3. Isolate Users with Active Directory

    This application is designed for option 3 and allows you to edit two attributes for a users account:

    • msIIS-FTPRoot
    • msIIS-FTPDir

    For more details on these attributes see the following page.

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adschema/adschema/a_msiis_ftproot.asp

    There is no Windows UI to perform this step but there is a way to edit these attributes using the IISFTP.vbs script that is installed when you install IIS with the FTP Service in IIS 6.

    The IISFTP.vbs script works fine but sometimes it is nicer and simpler to have a UI to help perform these steps. You also can see potential problems easier with a Windows UI.

    The Application

    This application has been written to in c# and requires the .NET Framework 2.0 (the new framework) to function. Windows 2003 Server Family by default installs the .NET Framework 1.1.

    The .NET Framework 2.0 redistributable can be downloaded from this page and is approx 22MB

    http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en

    You can then download and install this application from the URL below.

    http://blog.crowe.co.nz/Attachments/FTPUserEditor/setup.msi

    After you install the program a new item will be added to your Start - Programs folder called IIS Tools.

    When you run the application it will prompt you for a Windows Active Directory domain to log onto. You can log on with the currently logged on user account or you can specify another account to log on with.

    Once you log on you are then shown a tree of Folders and Organizational Units (OUs). Click on a node will display all user accounts in that folder or OU.

    You can select one or more users and right click and select Edit which will bring up the User Editor dialog.

    This dialog allows you to set or clear the attributes that are required for users to log on to the FTP server.

    If you have any comments on this application ( or bug reports ) please let me know at iismvp2005@iisfaq.homeip.net

    Cheers

    Chris Crowe [ IIS MVP 1997 -> 2006 ]
    http://www.microsoft.com/windows2000/community/mvp/bios/crowe.mspx

    Additional references

    Hosting Multiple FTP Sites with FTP User Isolation (IIS 6.0)
    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b63de8ef-e3c5-456d-a8ca-7af4198819d4.mspx


    Microsoft SMTPDiag

    SMTPDiag issues DNS queries using both User Datagram Protocol (UDP) and Transmission Control Protocol (TCP) to validate that the queries will succeed. Versions of Windows before Microsoft® Windows® Server™ 2003 and Microsoft Windows® XP did not support UDP queries. If TCP queries fail, mail will not be delivered successfully.

    The first thing that SMTPDiag does after verifying syntax is to check the Start of Authority (SOA) record for the remote address domain. The next step is to validate that the local domain MX/A records are resolvable. This test verifies that the sender domain is valid and any bounces can return to the originating server. This test could fail if the domain is not resolvable from inside the firewall. The remote domain MX/A records are then checked also. If this step fails, mail will not route because of issues with DNS. At this point, the network DNS infrastructure must be investigated.

    When all the DNS records have been successfully queried, the tool will try to connect to all the MX (mail exchange) records that were published for the remote domain on port 25 and try to do an EHLO, mail from, rcpt to, and quit command.

    If you use the verbose (/v) option when you run the tool, more information will be provided about what each test is doing, as well as detailed results of each test step.

    Usage

    SMTPDIAG "sender address" "recipient address" [-d target DNS] [/v]

     

    Argument Function
    sender address Required. Address of a local mailbox. Used to verify SMTP submission and check inbound DNS.
    recipient address Required. E-mail address of remote mailbox you are trying to send mail to. Used to verify DNS, and remote mailbox availability.
    -d target DNS Optional. IP address of target DNS server to use to look up remote MX (mail exchange) records for testing. This is often configured as an external DNS server in Exchange. The external DNS setting is not available for Internet Information Services (IIS) SMTP.
    /v Optional. Displays additional information about each test.
    /? Displays Help

    Diagnostics

    Results are displayed in four colors, as follows:

    • White text indicates action being taken. (in the sample below it is Bold Purple)
    • Gray indicates informational results (in the sample below it is Black).
    • Green indicates a successful test result.
    • Red indicates a failed test result.

    Example

    Searching for Exchange external DNS settings.
    Computer name is CHRIS.

    Checking SOA for domain.com.
    Checking external DNS servers.
    Checking internal DNS servers.

    Checking TCP/UDP SOA serial number using DNS server [192.168.2.2].
    TCP test succeeded.
    UDP test succeeded.
    Serial number: 2005120602

    Checking TCP/UDP SOA serial number using DNS server [200.97.33.1].
    TCP test succeeded.
    UDP test succeeded.
    Serial number: 2005120602

    Checking TCP/UDP SOA serial number using DNS server [200.96.152.4].
    TCP test succeeded.
    UDP test succeeded.
    Serial number: 2005120602

    Checking TCP/UDP SOA serial number using DNS server [200.96.152.12].
    TCP test succeeded.
    UDP test succeeded.
    Serial number: 2005120602
    SOA serial number match: Passed.

    Checking local domain records.
    Starting TCP and UDP DNS queries for the local domain. This test will try to validate that DNS is set up correctly for inbound mail. This test can fail for 3 reasons.

    Local domain is not set up in DNS. Inbound mail cannot be routed to local mailboxes.

    Firewall blocks TCP/UDP DNS queries. This will not affect inbound mail, but will affect outbound mail.

    Internal DNS is unaware of external DNS settings. This is a valid configuration for certain topologies.

    Checking MX records using TCP: domain.com.
          MX: mail.domain.com (5)
          MX: mx1.iserve.net.nz (10)
          A: mail.domain.com [200.79.73.229]
    Checking MX records using UDP: domain.com.
          MX: mail.domain.com (5)
          MX: mx1.iserve.net.nz (10)
          A: mail.domain.com [200.79.73.229]
          A: mx1.iserve.net.nz [202.191.32.2]
          A: ns1.iserve.net.nz [202.191.32.1]
          A ns2.iserve.net.nz [202.191.33.1]

    Both TCP and UDP queries succeeded. Local DNS test passed.

    Checking remote domain records.
    Starting TCP and UDP DNS queries for the remote domain. This test will try to validate that DNS is set up correctly for outbound mail. This test can fail for3 reasons.

    Firewall blocks TCP/UDP queries which will block outbound mail. Windows 2000/NT Server requires TCP DNS queries. Windows Server 2003 will use UDP queries first, then fall back to TCP queries.

    Internal DNS does not know how to query external domains. You must either use an external DNS server or configure DNS server to query external domains.

    Remote domain does not exist. Failure is expected.

    Checking MX records using TCP: domain.com.
          MX: mail.domain.com (5)
          MX: mx1.iserve.net.nz (10)
          A: mail.domain.com [200.79.73.229]
    Checking MX records using UDP: domain.com.
          MX: mail.domain.com (5)
          MX: mx1.iserve.net.nz (10)
          A: mx1.iserve.net.nz [202.191.32.2]
    Both TCP and UDP queries succeeded. Remote DNS test passed.

    Checking MX servers listed for chris.crowe@domain.com.
    Connecting to mail.domain.com [200.79.73.229] on port 25.
    Received:
    220 iisfaq.domain.net Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at Thu, 19 Jan 2006 08:03:32 +1300

    Sent:
    ehlo domain.com
    Received:
    250-iisfaq.domain.net Hello [192.168.2.1]
    250-TURN
    250-SIZE
    250-ETRN
    250-PIPELINING
    250-DSN
    250-ENHANCEDSTATUSCODES
    250-8bitmime
    250-BINARYMIME
    250-CHUNKING
    250-VRFY
    250-X-EXPS GSSAPI NTLM LOGIN
    250-X-EXPS=LOGIN
    250-AUTH GSSAPI NTLM LOGIN
    250-AUTH=LOGIN
    250-X-LINK2STATE
    250-XEXCH50
    250 OK

    Sent:
    mail from: <chris@domain.com>

    Received:
    250 2.1.0 chris@domain.com....Sender OK

    Sent:
    rcpt to: <chris.crowe@domain.com>

    Received:
    250 2.1.5 chris.crowe@domain.com

    Sent:
    quit

    Received:
    221 2.0.0 iisfaq.domain.net Service closing transmission channel

    Successfully connected to mail.domain.com.
    Connecting to mx1.iserve.net.nz [202.191.32.2] on port 25.Received:
    220 mx1-2.iserve.net.nz ESMTP

    Sent:
    ehlo domain.com

    Received:
    250-mx1-2.iserve.net.nz
    250-PIPELINING
    250-8BITMIME
    250 SIZE 20971520

    Sent:
    mail from: <chris@domain.com>

    Received:
    250 ok

    Sent:
    rcpt to: <chris.crowe@domain.com>

    Received:
    250 ok

    Sent:
    quit

    Received:
    221 mx1-2.iserve.net.nz

    Successfully connected to mx1.iserve.net.nz.


    Microsoft IIS tools have been updated...

    Microsoft has released the January 2006 IIS toolkit.

    • Fetch 1.4:  Remove the browser from scenario and make raw custom HTTP/S requests to your IIS Web Server
    • Debug Diagnostics 1.0:  Track down problems with IIS Crashes, Hangs, or Memory Leaks using this tool
    • Trace Diag:  This is a combined toolset aimed at helping users of Windows Server 2003 Service Pack 1’s tracing easier.  It includes IISREQMON, IISTRACE for the command-line and IIS Request Viewer (User Interface) and installs only on SP 1 and higher versions of Windows. 

    This release also included some updates to SSLDiag to version 1.1.  This included support for the following:

    • Service Pack 1’s Host Header support for SSL
    • SelfSSL complete functionality on the command-line (ssldiag /selfssl)
    • Limit diagnostics with User Interface to single site (for use on large or specific diagnostic situations – ssldiag /s:<siteid>)

     **Important:  Log Parser 2.2, SMTPDiag 1.0, and AuthDiag 1.0 were unchanged in this release.

     

    For details about each platform, please use the following URL:

     

      (x86) Landing: http://www.microsoft.com/downloads/details.aspx?FamilyID=9BFA49BC-376B-4A54-95AA-73C9156706E7&displaylang=en

      (x64) Landing: http://www.microsoft.com/downloads/details.aspx?FamilyID=7e42b310-b2d1-496b-8005-9d91782b9995&DisplayLang=en

      (ia64) Landing: http://www.microsoft.com/downloads/details.aspx?FamilyID=13c1c5e5-592c-45bc-b5bb-c486b43eb539&DisplayLang

     


    URL Rewriting and Alternative Authentication Methods
    • Mod_Rewrite - URL Rewrite
      Opensource and FREE for private and commercial use
      Powered by regular expressions Mod Rewrite adds a flexible URL rewriting engine to your IIS.

      With Mod Rewrite you can:
      • Convert dynamic URLs to static.
      • Make your site's URLs user and search engine friendly 
      • And much more...


    • Mod Auth - IIS Authentication
      Opensource and FREE for private and commercial use

      Add the ability of authorization and authentication without using Windows accounts.
      Excelent for membership systems.

    Display a list of all sites on the local IIS server and the bindings (IP Address, TCP/IP Port, Host Header) that they have.

    This script will show you each Web Site ID and the description and the bindings that they are using.

    Save the script to a file with a .VBS file extension and then run using this command:

    cscript  MyFile.VBS

    MachineName = "localhost"
    IIsObjectPath = "IIS://" & MachineName & "/w3svc"


    Set IIsObject = GetObject(IIsObjectPath)
    for each obj in IISObject
    if (Obj.Class = "IIsWebServer") then
    BindingPath = IIsObjectPath & "/" & Obj.Name

    Set IIsObjectIP = GetObject(BindingPath)
    wScript.Echo IISObjectIP.ServerComment & " ( W3SVC" & obj.Name & " ) "

    ValueList = IISObjectIP.Get("ServerBindings")
    ValueString = ""
    For ValueIndex = 0 To UBound(ValueList)
    value = ValueList(ValueIndex)
    Values = split(value, ":")
    IP = values(0)
    if (IP = "") then
    IP = "(All Unassigned)"
    end if
    TCP = values(1)
    if (TCP = "") then
    TCP = "80"
    end if
    HostHeader = values(2)

    if (HostHeader <> "") then
    wScript.Echo " IP = " & IP & " TCP/IP Port = " & TCP & ", HostHeader = " & HostHeader
    else
    wScript.Echo " IP = " & IP & " TCP/IP Port = " & TCP
    end if
    Next
    wScript.Echo ""
    set IISObjectIP = Nothing
    end if
    next
    set IISObject = Nothing

    Example Output

    Default Web Site ( W3SVC1 )
    IP = 10.1.1.11 TCP/IP Port = 80

    WebSite1 ( W3SVC1036328378 )
    IP = 10.1.1.74 TCP/IP Port = 80

    WebSite2 ( W3SVC1816184000 )
    IP = 10.1.1.73 TCP/IP Port = 80

    WebSite3 ( W3SVC1867813904 )
    IP = 10.1.1.72 TCP/IP Port = 80

    WebSite4 ( W3SVC568530179 )
    IP = 10.1.1.71 TCP/IP Port = 80

    WebSite5 ( W3SVC719499532 )
    IP = 10.1.1.70 TCP/IP Port = 80

    WebSite6 ( W3SVC669732006 )
    IP = (All Unassigned) TCP/IP Port = 81
     

     


    Displaying the Web Site ID and the Description

    This script will show you the W3SVC Web Site ID and the description.

    With IIS 6 the Web Site ID is a randomly generated number for each site that is created other than the Default Web Site which has an Web Site ID of 1)

    For example:

    W3SVC1
    W3SVC719499532
    W3SVC383732556

    Knowing which web site these being to is a problem as it requires you to manually look at each web site. The following script will allow you to output the ID and name.

    Save the script to a file with a .VBS file extension and then run using this command:

    cscript  MyFile.VBS

    Function ProcessWebSite(ServiceType, SiteNumber)
    Set IISWebSite = getObject("IIS://localhost/" & ServiceType & "/" & SiteNumber)
    Set IISWebSiteRoot = getObject("IIS://localhost/" & ServiceType & "/" & SiteNumber & "/root")
    ProcessWebSite = IISWebSite.ServerComment
    Set IISWebSiteRoot = nothing
    Set IISWebSite = Nothing
    end function

    Function ShowSites(ServiceType, ClassName, Title)
    Wscript.echo "Web Sites Description"
    Wscript.echo "==============================================================="
    Set IISOBJ = getObject("IIS://localhost/" & ServiceType)
    for each Web in IISOBJ
    if (Web.Class = ClassName) then
    wscript.echo Ucase(ServiceType) & "/" & Web.Name & _
    Space(17-(len(Ucase(ServiceType))+1+len(Web.Name))) & " " & _
    ProcessWebSite(ServiceType, Web.name)
    end if
    next
    Set IISOBj=Nothing
    WScript.Echo ""
    End function

    Call ShowSites("w3svc", "IIsWebServer", "Web")

    The output from this is similar to the following:

    Web Sites                    Description
    ===============================================================
    W3SVC/1                   Default Web Site
    W3SVC/1036328378 WebSite1
    W3SVC/1816184000 WebSite2
    W3SVC/1867813904 WebSite3
    W3SVC/568530179   WebSite4
    W3SVC/719499532   WebSite5
    W3SVC/669732006   WebSite6

    Chris Adams Blog (IIS Program Manager)

    Chris Adams - IIS Program Manager has told me he is going to maintain his blog daily - with his view inside of Microsoft in the IIS team he knows a lot of information that we can all find very useful.

    He already has some good blog entries on:

    • Host Headers and SSL
    • Installing IIS to a non system partition
    • Log Parser Scripts
    • Logging Time Taken to determine slow pages.

    http://blogs.technet.com/chrisad

     


    Trying to administer Front Page Server Extensions results in you being prompted to Log on

    When you use the fully qualified domain name (FQDN) to administer a web site that is configured to use Host Headers on a computer that is running Windows XP SP2 or Windows 2003 Server SP1, you may receive an authentication dialog that will not accept any credentials that you enter.

    This can be seen by right clicking a web site and try to configure the Front Page Server Extensions which will open.

    This can be cuased by Windows XP SP2 and Windows Server 2003 SP1 which include a loopback check security feature that is designed to help prevent reflection attacks on your computer. Therefore, authentication fails if the FQDN that you use does not match the local computer name which if using host headers probably does not.
     

    To work around this you could disable the loopback check

    Follow these steps:
    1. Click Start, click Run, type regedit, and then click OK.
    2. In Registry Editor, locate and then click the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
    3. Right-click Lsa, point to New, and then click DWORD Value.
    4. Type DisableLoopbackCheck, and then press ENTER.
    5. Right-click DisableLoopbackCheck, and then click Modify.
    6. In the Value data box, type 1, and then click OK.
    7. Quit Registry Editor, and then restart your computer.
     

    New Podcast - IIS Show on Channel 9

    Brett Hill, IIS Technical Evangelist for Microsoft kicks off a new Podcast series dedicated exclusively to IIS.

    In the first in the series Brett review’s IIS 6 security and discusses IIS 7 features including why developers should be looking now at IIS 7 capabilities.
    http://channel9.msdn.com/Showpost.aspx?postid=124807

    In the second in the series Brett interviews rock star developer Rick Strahl from Westwind Technologies on his recent experience with IIS 7. Rick discusses how he much prefers working in managed code and the new world of IIS 7 modules.
    http://channel9.msdn.com/Showpost.aspx?postid=128639

    Every two weeks, expect a new podcast featuring members of the IIS 7 product team and other key players in IIS technology.
    http://channel9.msdn.com/ShowForum.aspx?ForumID=34&TagID=15


    6 Webcasts from the Microsoft IIS Webcast Team within the next week.

    The Microsoft IIS Webcast Team is extremely excited by this upcoming week where we have 6 upcoming webcasts.  We currently have a very real-world series entitled:  "A look inside Microsoft.com Operations."  These include some very cool topics listed below -

    An Insiders Look At Microsoft.com

    An IIS Webcast Series

    The Internet is the most volatile network in the world. It is constantly challenged by "hackers" who are content with causing chaos for Web Administrators and Developers.  The busiest web site in the world, www.microsoft.com, is managed by a group of people who know what the term "in the trenches" means.  If you are interested in understanding how the operations group at Microsoft.com does business then this webcast series if for you. From one IT professional to another, find out how Microsoft.com continues to lead the world in operational excellence and website availability.  The topics in this week long view of Microsoft.com operations will include the architecture, replication and management of website configuration and content, and network topology used to create a true "99.9" availability rating.

    Here are the links to sign up for the upcoming webcast series. Go to http://www.microsoft.com/events/default.mspx, then click on the More live webcasts. link at the bottom of the page scroll to the date of the event.

    Monday Nov 7, 2005 11:30am
    MSCOM- High Availability Architecture

    Hear from the System Engineers who operate the highest scale IIS solutions  on the Internet; including www.Microsoft.com, Windows Update, MSDN/Technet, Downloads, and more.  They will share their web hosting secrets for High Availability architectures, including the areas surrounding Network Security, Cluster & Host Level Load Balancing, and Web & Database server distributions.

    Tuesday Nov 8, 2005 9:30am
    MSCOM- Configuration Management of Web Farms

    Get 1-on-1 with Sr. System Engineers responsible for running www.Microsoft.com and Windows Update to see how they perform scripted
    administration and deployment of configuration settings across the infrastructure.  Engineers will have sample scripts and provide visibility into how they leverage various commands which release with Windows Server 2003 and IIS 6.0.

    Wednesday Nov 9, 2005 11:30am
    MSCOM- Change & Release Management Strategies

    Microsoft.com Operations will provide insight into how they handle and manage software updates; such as Operating System deployments, Service Pack's & Security Patches.  They will also cover the approach used to manage application releases to environments, and strategies leveraged with the Product Development organizations (Development, Test & Program Mgmt) regarding Software Development Release Cycle (SDLC)

    Thursday Nov 10, 2005 11:30am
    MSCOM- Monitoring & Management of Enterprise Platform

    Microsoft.com Operations is currently responsible for managing more than 2000 Windows Servers hosted in 3 remote Data Centers.  Partner up with their Sr. Engineers to understand how they leverage a suite of technologies and operational processes to establish Asset Management, Event / Log / Performance Data Collection and Reporting, as well System & Application level uptime analysis.  Session will include how they leverage Active Directory and Microsoft Operations Manager (MOM) within the overall framework of their solution.


    Friday Nov 11, 2005 11:30am
    MSCOM - Troubleshooting & Debugging Web Hosting Environments

    Dive under the hood with our Sr. System Engineers at Microsoft.com Operations to see how they troubleshoot and debug the array of hosted ASP.NET applications and database driven systems.  They will provide "How  To" real life scenarios covering commonly leveraged tools such as LogParser, Server Performance Advisor (SPA), Performance Monitor, Network Monitor, and more.  The team will also cover some common debug dump analytic procedures used when those tools and corresponding data have not identified root cause of a problem.


    Tuesday Nov 8, 2005 11:30am
    Finding IIS Bottlenecks using Server Performance Advisor

    Microsoft Internet Information Services (IIS) has been a "black box" for many versions now. Have you had the urge to open it up? IIS 6.0 on Microsoft Windows Server 2003 delivers a strong infrastructure for finding problems with Web applications. Using Microsoft Windows Server 2003 Enterprise Tracing for Windows (ETW), the Server Performance Advisor (SPA) can compile statistical data on your Web applications for later review. This webcast covers the basics around SPA and ETW and looks at how to set up, configure, and analyze the data collected by SPA.


    FTP Error Status Codes
    Code Description
    100 Codes The requested action is being taken. Expect a reply before proceeding with a new command.
    110 Restart marker reply.
    120 Service ready in (n) minutes.
    125 Data connection already open, transfer starting.
    150 File status okay, about to open data connection.
    200 Codes The requested action has been successfully completed.
    200 Command okay.
    202 Command not implemented
    211 System status, or system help reply.
    212 Directory status.
    213 File status.
    214 Help message.
    215 NAME system type. (NAME is an official system name from the list in the Assigned Numbers document.)
    220 Service ready for new user.
    221 Service closing control connection. (Logged out if appropriate.)
    225 Data connection open, no transfer in progress.
    226 Closing data connection. Requested file action successful (file transfer, abort, etc.).
    227 Entering Passive Mode
    230 User logged in, proceed.
    250 Requested file action okay, completed.
    257 "PATHNAME" created.
    300 Codes The command has been accepted, but the requested action is being held pending receipt of further information.
    331 User name okay, need password.
    332 Need account for login.
    350 Requested file action pending further information.
    400 Codes The command was not accepted and the requested action did not take place.
    Tthe error condition is temporary, however, and the action may be requested again.
    421 Service not available, closing control connection. (May be a reply to any command if the service knows it must shut down.)`
    425 Can't open data connection.
    426 Connection closed, transfer aborted.
    450 Requested file action not taken. File unavailable (e.g., file busy).
    451 Requested action aborted, local error in processing.
    452 Requested action not taken. Insufficient storage space in system.
    500 Codes The command was not accepted and the requested action did not take place.
    500 Syntax error, command unrecognized. This may include errors such as command line too long.
    501 Syntax error in parameters or arguments.
    502 Command not implemented.
    503 Bad sequence of commands.
    504 Command not implemented for that parameter.
    530 User not logged in.
    532 Need account for storing files.
    550 Requested action not taken. File unavailable (e.g., file not found, no access).
    552 Requested file action aborted, storage allocation exceeded
    553 Requested action not taken. Illegal file name.

    Basic Web Site Usage Statistics - SpotCheck

    Spotcheck is a handy, freeware program that provides basic site usage statistics from IIS log files. You don't have to look at any advertising or give us an email address. Just download and use.

    For more details see : http://www.tcpdata.com/sc_dl.shtml


    Microsoft Availability Reporting Management Pack for Microsoft Operations Manager 2005
    The Microsoft Operations Manager 2005 Availability Reporting Management Pack collects and analyzes data for Microsoft SQL Server, Exchange, IIS, AD, it uses the event logs of your servers, and generates reports that you can study to improve server availability and reliability. You can identify the causes for planned and unplanned downtime and take preemptive actions to decrease downtime in the future.

    Availability Reporting uses a number of metrics to provides data that you can view and customize to suit the needs of your IT organization. Each type of report includes tables or graphs with information about the availability and reliability of servers in your environment. You can input parameters, such as specific periods of time, to filter the data presented in the reports.

    Availability Reports provide detailed and specific availability and reliability information for several Microsoft applications. For applications not currently supported, Availability Reporting provides basic availability and reliability statistics at the operating system level. In such cases, Availability Reporting measures whether the operating system is running but does not measure whether applications are running.
     

    IIS Metabase References

    The following Microsoft Sites contain details on the IIS Metabase properties

    Metabase Property Reference (IIS 5.0)
    http://www.microsoft.com/windows2000/en/server/iis/default.asp?url=/windows2000/en/server/iis/htm/asp/apro3usl.htm?id=354

    Metabase Property Reference (IIS 6.0)
    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/cde669f1-5714-4159-af95-f334251c8cbd.mspx


    Looking for online IIS 6 Documentation?

    The Microsoft Technet site has a number of document categories related to IIS 6.

    • IIS 6.0 Documentation
    • IIS 6.0 Content Revision Summary
    • IIS 6.0 Typographical Conventions
    • IIS 6.0 Glossary
    • IIS 6.0 Deployment Guide
    • IIS 6.0 Operations Guide
    • IIS 6.0 Technical Reference

    For more details see:
    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/848968f3-baa0-46f9-b1e6-ef81dd09b015.mspx


    Windows Deployment and Resource Kits Online

    Below are a list of the Microsoft Resource Kits that are available online.

    Internet Information Services (IIS) 6.0 Resource Guide
    This searchable technical reference provides information about running IIS as a Web application platform, ensuring that IIS stays secure, monitoring and tuning IIS, administering the server programmatically, and capitalizing on built-in IIS scalability features to manage large-scale deployments.

    Internet Information Services (IIS) 6.0 Resource Kit Tools
    The IIS 6.0 Resource Kit Tools can help you administer, secure, and manage IIS. Use them to query log files, deploy SSL certificates, employ custom site authentication, verify permissions, troubleshoot problems, migrate your server, run stress tests, and more.

    Internet Information Services (IIS) 6.0 Deployment Guide
    Get a prescriptive, task- and scenario-based guidance to help you design and deploy an IIS 6.0 solution–be it a new installation, upgrade, or migration–within your organization. Deploying Internet Information Services (IIS) 6.0 is available as part of the Microsoft Windows Server 2003 Deployment Kit.


    Microsoft Windows Server 2003 Resource Kit: Special Promotional Edition
    Get the definitive resource for Windows Server 2003, filled with practical guidance on managing and tuning system performance to help optimize speed, reliability, and efficiency.

    Windows Server 2003 Technical Reference
    Looking for The Microsoft Windows Server 2003 Resource Kit? See the Windows Server 2003 Technical Reference documentation, which provides comprehensive information about the technologies included in the Microsoft Windows Server 2003 operating system. This set of Technical Reference documentation is designed to assist IT planners and administrators by providing the foundational information about the technology components of the operating system.

    Windows Server 2003 Deployment Kit
    The Microsoft Windows Server 2003 Deployment Kit provides guidelines and recommended processes for designing and deploying Windows Server 2003 technologies to meet your business needs and IT goals.

    Migrating from Microsoft Windows NT Server 4.0 to Windows Server 2003
    The Migrating from Microsoft Windows NT Server 4.0 to Microsoft Windows Server 2003 guide is designed for IT administrators in small- and medium-sized organizations. It provides guidelines for the migration of domain controller, DHCP/WINS server, file/print server, remote access server, and Web server roles from Windows NT 4.0 to Windows Server 2003.

    Windows Server 2003 Resource Kit Tools
    The Resource Kit Tools are a set of software tools for network administrators, developers, and power users to manage TCP/IP, networks, the registry, security, remote administration, configuration, batch files, and many other areas of the Windows Server 2003 operating system. To install the tools, download and run Rktools.exe.

    Windows XP Professional Resource Kit Documentation
    Windows XP Professional Resource Kit Documentation helps IT professionals deploy, manage, and support the Windows XP operating system. In addition to this free online version of the printed book, Windows XP Professional Resource Kit Documentation is available in print from Microsoft Press.

    Windows 2000 Resource Kits
    From the Windows 2000 Resource Kits home page, you can view Windows 2000 Resource Kit books and references online, review extensive information about deploying Windows 2000, download free tools, and buy the Windows 2000 Resource Kits.

    Windows 2000 Resource Kit Tools
    These tools help you streamline administrative tasks such as managing Active Directory, administering security features, working with Group Policy and Terminal Services, automating application deployment, and other important jobs. This page contains updated versions of the most popular and useful Resource Kit tools.

    Web Resources Page
    These resources are referenced in the Windows Resource Kits and lead to information that is useful to Windows users.

    Other Microsoft Resource Kits
    Get easy access to product Resource Kits here.


    Do you want to stay up on the security vulnerabilities in a number of different products - More than 5500 products!

    Secunia monitors vulnerabilities in more than 5500 products

    The following are the IIS 6 vulnerabilities since 2003 as of September 22, 2005

    Below is the list of vulnerabilities for Apache 2 since 2003 as of September 22, 2005 (just a bit more than IIS 6)

    For more details see : http://secunia.com/


    Get ideas of keywords for your web sites

    Get ideas for new keywords that can help you improve your relevance to queries that user submit to search engines

    Google
    https://adwords.google.com/select/KeywordSandbox

    Example from Google

    I used the following keywords: 

    • Metabase, ADSI, Blog, iis, sharepoint, internet,information,services,ii5,iis6,Windows,Sharepoint

    and got the following results ( Note: more results where returned that displayed below )

    • internet providers
    • internet service providers
    • internet access
    • windows
    • cable internet
    • information
    • internet
    • services
    • dial up internet
    • internet banking
    • internet roaming
    • blog
    • escort services
    • windows media player
    • windows xp upgrade
    • cable internet service
    • sash windows
    • internet services
    • dating services
    • dial up internet access
    • phone services
    • cleaning services
    • cheap internet service
    • international internet
    • nanny services
    • hosting services
    • internet radio
    • information security
    • windows server
    • windows 98 upgrade
    • windows 2000
    • mailing services
    • moving services
    • management information system
    • iis


    Overture
    http://inventory.overture.com/d/searchinventory/suggestion/

    Example from Overture

    I used the following key word: 

    • IIS

    and got the following results ( Note: more results where returned that displayed below )

    Searches done in August 2005
    Count Search Term
     6481  iis
     1076  download iis
     593  o2 xda iis
     572  xda iis
     553  read iis server log
     460  microsoft iis
     403  iis intranet
     371  iis server
     369  ti 30x iis
     344  php iis
     336  iis window xp
     333  identix.com iis
     331  iis web server


    IIS - Where to get the Media to Install Internet Information Services

    Different versions of IIS are available although IIS 5, IIS 5.1 and IIS 6 are now the only real versions that you may want to install.

    The table below describes where you can install IIS from - although you use to be able to download IIS you no longer can do that as it is a part of the Operating System.

    Version Obtained from Operating System
    1.0 Included with Windows NT 3.51 SP 3 (or as a self-contained download). Windows NT Server 3.51
    2.0 Included with Windows NT Server 4.0 Windows NT Server 4.0
    3.0 Included with Windows NT Server 4.0 Service Pack 3 (Internet Information Server 2.0 is automatically upgraded to Internet Information Server 3.0 during the install of SP3.) Windows NT Server 4.0
    4.0 Self-contained download from www.microsoft.com or the Windows NT Option Pack compact disc Windows NT Server 4.0 SP3 and Microsoft Internet Explorer 4.01
    5.0 Built-in component of Windows 2000. Windows 2000
    5.1 Built-in component of Windows XP Professional (not included with Windows XP Home) Windows XP Professional
    6.0 Built-in component of Windows 2003 Server Windows 2003 Server

    ISAPI Filter - [Freeware] IIS password

    IIS password protection of files and folders has always been difficult. IISPassword brings the ease and power of Apache’s htaccess to Microsoft IIS. No longer is there a need for system user accounts and complex access permissions for maintaining a secure, password protected web site.

    IISPassword uses Basic HTTP Authentication for password protecting web sites on IIS, just like htaccess works on Apache. That makes your password protected Apache web site compatible with IIS, and vice versa.

    A powerful and intuitive interface makes it possible to password protect a web site in just moments. More advanced settings provide options such as user group management and protection of certain file types.

    Main Features

    • Easy installation - IISPassword is installed with an easy setup program.
    • Easy administration - IISPassword integrates with IIS, creating a new tab in the management console. Protecting a web site is very easy. Select the site or folder to protect, then a username and a password. That’s all there is to it. The advanced mode enables user groups and protection of certain file types.
    • High performance - IISPassword has been tested in a live environment with heavy traffic, generating practically no extra CPU load on the web servers.
    • Compatibility with htaccess - IISPassword makes password protected Apache web sites compatible with IIS, and vice versa.
    • Command line administration - IISPassword can be administrated through a command line interface, allowing automatic administration based on scripts or applications.

    Components

    • ISAPI filter - IISPassword is an ISAPI filter. This makes IISPassword a secure application with low performance costs.
    • IIS Snap-In - IISPassword is seamlessly integrated into the IIS management console, making password protection an easy task.
    • Command line tool - IISPassword also provides a command line interface for scripts or applications. This makes it possible to migrate IISPassword into existing control panel systems.

    IISPassword is free for private, educational and commercial use.

    For more details see:

    http://www.troxo.com/products/iispassword/


    IIS Guard - [Beta] Easily see all requests that are made to your IIS web server and find the sites and scripts that are causing problems

    The IIS web server can easily stop working due to corrupted or poorly written web scripts. There’s no monitoring tool included in the IIS web server itself, which makes it hard, if not impossible, to find and solve problematic sites or scripts.

    With IISGuard, this is a problem of the past. Now you can easily see all requests that are made to your IIS web server and find the sites and scripts that are causing problems.

    These are some of the problems that IISGuard can help you find in the IIS:

    • High CPU load or memory consumption.
    • Denial of Service attacks.
    • Attacks by worms and viruses.

    There’s no need to fumble in the dark any more, IISGuard lets you find what you’re looking for in no time.

    Features

    • Live Monitor. Watch requests to your IIS web server in real-time. It’s possible to both view currently active request and finished request. Requests that last a long time are marked.
    • Logging. IISGuard logs all requests and features an extensive built-in search function.
    • Configurability. IISGuard can be configured with various options. You can choose to monitor all file types or set up a filter that monitors only certain file types (e.g. asp, php, exe, dll).
    • Web interface. All features of IISGuard are accessible through a web interface.
    • Own web server. IISGuard contains a web server of its own, which makes it work independently of the IIS server. This means that when you need IISGuard the most, when the IIS server is experiencing problems, you’ll still be able to access it.
    • Performance. IISGuard has proven to perform extremely well in a real server hosting environment, with thousands of heavily loaded sites.
    • Ease of use. IISGuard is set-up within minutes. The web interface is both simple and intuitive.

    Note: This product is currently in Beta

    For more details see - http://www.troxo.com/products/iisguard/


    Looking for details on IIS 7 - Well check out these Videos

    To keep up to date checkout this page often:

    http://channel9.msdn.com/tags/IIS


    IIS Security Planning Tool

    The IIS Security Planning Tool helps administrators deploy IIS with security that's appropriate for the server's role. It uses a simple HTML interface to determine what services the server will provide, and recommends the deployment and installation options that will allow it to provide them securely.

    For more details see:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=166d3102-f5a8-49a2-b779-153b7f59bcd3&DisplayLang=en


    IIS - Internet Information Services (IIS) 6.0 Manager for Windows XP
    With IIS 6.0 Manager for Windows XP, administrators can remotely manage an IIS 6.0 server from a Windows XP Professional workstation. This tool only installs a snap-in for Microsoft Management Console and its associated DLLs and documentation; it does not install the complete IIS 6.0 server on your local computer.
    • This tool is available only in English. When installed on non-English editions of Windows XP, IIS 6.0 Manager, documentation, folders, and shortcuts appear as English-only.
    • After installation, IIS 6.0 Manager and IIS 5.1 Manager coexist in separate directories on the same computer.

    • Start the IIS 6.0 Manager after installation from the administrative tools folder in the Control Panel, not from the Computer Management console. If the IIS 5.1 Manager is also installed, it will appear in the Computer Management console, not the IIS 6.0 Manager.

    For more details see:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=f9c1fb79-c903-4842-9f6c-9db93643fdb7&DisplayLang=en


    IIS : Internet Information Services 6.0 Migration Tool
    The Internet Information Services 6.0 Migration Tool is a command line tool that automates several of the steps needed to move a Web application from IIS 4.0, IIS 5.0 or IIS 6.0 to a clean installation of Internet Information Services (IIS) 6.0. The tool transfers configuration data, Web site content, and application settings to a new IIS 6.0 server. Migrating applications to IIS 6.0 enables organizations to take advantage of the new fault-tolerant architecture available in IIS 6.0 and other features that increase Web server reliability, performance, and security.

    Update: A new version of the IIS 6.0 Migration Tool (iismt.exe) has been released to correct problems in version 1.0 of the tool. The follow problems with IISMT.exe have been addressed in this new version:

    IIS cannot spawn new worker processes during a migration.
    Cause: If the Migration is performed to a live production IIS6 server, existing sites may not serve properly until the migration completes. This behavior was because the migration tool locks the metabase during the migration. In the new version the the migration tool does not lock the metabase and hence existing sites on the destination server will continue to serve during the migration.

    Permissions of the AdminACL for the W3SVC/<siteID> in the IIS 6.0 metabase are incorrect after migration.
    Cause: The migration tool did not migrate the AdminACL correctly for the W3SVC/<siteID>. This resulted to web applications not functioning on the target IIS 6 server. Users may get "500 Internal Server Error" when browsing the migrated ASP web application or "Server Application is Unavailable" when browsing the migrated ASP.NET application.

    Migration Tool does not migrate nested applications correctly.
    Cause: The migration tool did not migrate nested application properly. The AppRoot metabase key is migrated as (/LM/W3SVC/<ID of site on source>/Root/....) instead of (/LM/W3SVC/<ID of site on Target>/Root/....) which resulted to web application not bering served. Users may get "500 Internal Server Error" when browsing the migrated ASP web application or "Server Application is Unavailable" when browsing the migrated ASP.NET application.
    A new version of the IIS6 Migration Tool (version 1.1) has been released to address the above issues.

    Note: All versions of the IIS Migration Tool have the following known limitations:
    • If you are migrating from NT4 with FPSE 98, and you choose to migrate with /fpse switch, it is possible that the Server Extensions will not function properly on IIS6 as they were on IIS4. The only recommended workaround is to upgrade to FPSE 2000 or FPSE 2002 on the source server (NT4) before beginning the migration.
    • The migration can be performed for only one individual site at a time, if you want to migrate the entire IIS server. You may want to put all the migration commands in a batch or script file.
    • Files that are located in a directory structure that exceeds MAX_PATH are not migrated. The migration tool will error out with "Access Denied" and stops the migration.
    • If you migrate the same site twice and the administrators group does not have full control permission on the source content, the migration tool will error out the second time with an "Access Denied" error. To workaround this, you can either give the administratorsgroup full control on the source content or delete the content on the destination server before you run the migration the second time.

    For more details see:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=2aefc3e4-ce97-4f25-ace6-127f933a6cd2&DisplayLang=en


    IIS Diagnostics Kits

    The IIS Diagnostics Toolkit is a combined release of popular tools used by today's IIS users. These tools include tools aimed at resolving problems related to Secure Socket Layer (SSL) issues, permission or security problems, gathering data for your SMTP server included with IIS, as well as the famous Log Parser utility used to sift through hundreds or thousands of log files very quickly.

    The toolkit consolidates all the tools into a convienant download and is supplemented by updates every 90-days to ensure that users have the most current diagnostics tools at their fingertips.

    For more details see:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=9bfa49bc-376b-4a54-95aa-73c9156706e7&DisplayLang=en


    Authentication and Access Control Diagnostics 1.0 (more commonly known as AuthDiag) is a tool released by Microsoft aimed at aiding IT professionals and developers at more effectively finding the source of authentication and authorization failures.

    These users have often seen behavior from Internet Information Services (IIS) that doesn't seem appropriate or random when users authenticate to the IIS server. The complex world of authentication types and the various levels of security permissions necessary to allow a user to access the server causes many hours of labor for those tasked with troubleshooting these problems.

    AuthDiag 1.0 offers a robust tool that offers a efficient method for troubleshooting authentication on IIS 5.x and 6.0. It will analyze metabase configuration and system-wide policies and warn users of possible points of failure and guide them to resolving the problem. AuthDiag 1.0 also includes a robust monitoring tool called AuthMon designed at capturing a snapshot of the problem while it occurs in real-time. AuthMon is robust and specially designed for IIS servers removing any information not pertinent to the authentication or authorization process.

    For more details see:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=e90fe777-4a21-4066-bd22-b931f7572e9a&DisplayLang=en


    A common problem for administrators of IIS servers is configuring and troubleshooting SSL enabled websites. To assist in administrators efforts, Microsoft has designed a tool - SSL Diagnostics - to aid in quickly identifying configuration problems in the IIS metabase, certificates, or certificate stores.

    This tool allows users to review configuration information in a easy to read view mode or to run the tool silently with only the creation of a log file. During use, administrators can simulate the SSL handshake to find errors. They can also quickly "hot swap" certificates for testing purposes.

    These packages come in two forms: Express and Full. The express will only give the pertinent tools for administrators to use SSL Diagnostics while full install installs the same files with the appropriate documentation. Included in the full install is a SSL Frequently Asked Questions that can assist in the learning of SSL for administrators

    For more details see:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=cabea1d0-5a10-41bc-83d4-06c814265282&DisplayLang=en


    The IIS 6.0 Resource Kit Tools can help you administer, secure, and manage IIS. Use them to query log files, deploy SSL certificates, employ custom site authentication, verify permissions, troubleshoot problems, migrate your server, run stress tests, and more.

    The following tools are available in this package:

    • IIS 6.0 Migration Tool Version 1.0 Version 1.1 Now Available!
    • Apache to IIS 6.0 Migration Tool Version 1.0
    • CustomAuth Version 1.0
    • IISCertDeploy.vbs Version 1.0
    • IIS Host Helper Service Version 1.0
    • IISState Version 3.0
    • Log Parser Version 2.1 Version 2.2 Now Available!
    • Metabase Explorer Version 1.6
    • Permissions Verifier Version 1.0
    • RemapUrl Version 1.0
    • SelfSSL Version 1.0
    • TinyGet Version 5.2
    • Web Capacity Analysis Tool Version 5.2
    • WFetch Version 1.3

    For more details see:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&DisplayLang=en


    IIS - Internet Information Server Management Pack for MOM 2005

    The Microsoft Internet Information Services (IIS) Management Pack provides availability, health, and configuration monitoring of IIS and its related services.

    By monitoring the applications and Web sites running on IIS, this Management Pack highlights issues that cause downtime or poor performance, such as broken links, unavailable sites, and security breaches.

    The IIS Management Pack also collects performance analysis and capacity planning data by tracking application performance and user load.

    The Microsoft Windows Internet Information Services Management Pack Guide describes the content of the management pack, and describes how to deploy it.

    You can download the management pack guide from the Microsoft Web site:
    http://www.microsoft.com/downloads/details.aspx?FamilyId=F2049784-923D-4A33-B377-C39CE94A193B\

    For more details see:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=9451088D-87DE-42E9-8FD3-F005A184DD65&displaylang=en


    SQL Server 2005 Mobile Edition Server Tools Beta 1 for use with IIS and SQL Server 2005 Beta 2 (USA)

    This release of SQL Mobile Server Tools installs the necessary components on servers running IIS to support connectivity solutions to SQL Server 2000 and SQL Server 2005 Beta 2 databases.

    SQL Server 2005 Mobile Edition (SQL Mobile) is the compact database for rapidly developing applications in both native mode and the .NET Compact Framework that extend enterprise data management capabilities to devices.

    Companies and users of SQL Mobile that plan to synchronize to SQL Server 2000 or SQL Server 2005 Beta 2 databases will need to install this Server Tools release on their servers running Internet Information Services (IIS).

    For more details see:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=0A6174A4-C009-4768-8284-698C32EC84E3&displaylang=en


    IIS - Scripts for managing Internet Information Server
     

    If you are looking to manage IIS using scripts instead of having to use the GUI the following resources may be helpful to you.

    Scripts hosted on www.iisfaq.com - written mostly by me in VBScript using ADSI for IIS 4+

    Backup and Restore

    How do I backup the Metabase using a script?
    How to get a listing of all the Metabase backups that have been made?

    Content Indexing

    Enum if a web site folders are enabled/disabled for content indexing

    Custom Headers

    How to add an entry to the CustomHeaders?
    How to view the CustomHeaders defined for a specific web site?

    FTP

    How can I get a simple listing of the FTP Sites on my Web Server
    How do I add a new FTP site using ADSI?
    How to find the default logon domain for an FTP site?
    How to set the default logon domain for an FTP Site?
    Is there a way to force the FTP filenames to appear in lowercase?
    makeFTPDirsFromTextFile.vbs

    IP Address

    Changing the IP Address of a large number of Web Sites which are configured using Host Headers
    How can I change the IP Address on a particular web site?
    How can I export my list of IP And Domain name restrictions from a website?
    How can I set 2000 IP address and domain name restrictions?
    How do I add multiple IP Addreses to my Web Site?
    How do I list all the web sites and the IP addresses associated with each web site?
    I get a message "A duplicate name exists on the network" how do I find what site is the duplicate?
    I have 100 IP Addresses and would like a script to tell me which IP address to use next.
    I have about 50 websites on a NT 4 server that I need to change the IPaddress for each due to IP address changes.

    ISAPI Filters

    How do I add an ISAPI filter to my Web Site using a Script?
    How do I know what custom ISAPI filters are defined on my Web Sites?
    More details on ISAPI Extensions and Filters

     Log Files

    How can I delete all files from my IIS log file directory that are over 90 days old?
    How can I find out all the log options that have been set?
    How can I find out what files are in my IIS log directory for a particular web site?
    How can I get a listing of all the log file directories and if they exist or not?
    How can I set the Log File Directory?
    How do I find all the available web site logging formats available?
    I have a lot of log files on my system how can I archive them easily?
    I see how to change, read, write browse in the directory tab, but I can't find anything about the 'Index this resource' box?
    This script will export relevant IIS settings to a log file that you can import into MSAccess or MS Excel.

    MIMEMAP

    How can I add an entry to the MIMEMAP?
    How can I delete an entry from the MIMEMAP?
    How can I disable caching of specific file types?
    How can I display the items in the MIMEMAP?

    Misc Scripts

    Do do I add or remove a Script Mapping?
    How can I determine from within my script if IIS is version 4 or Version 5?
    How can I determine if a web site or virtual directory points to a specific physical path?
    How can I enable pass through authentification on IIS5?
    How can I find all the properties available for an IIS ADSI object?
    How can I set the application protection level - such as Low (InProcess), Medium (Pooled) or High (Out Of Process)?
    How do I find all the invalid paths in my web server?
    How do I read a web page from the server and then show it to the user?

    Passwords and Authentication

    How can I find out the password for the IUSR_Computername account?

    Scripting DNS Zones and Resource Records

    HowTo: Scripting DNS entries in Windows 2000

    SMTP

    How can I find the files in the SMTP service BADMAIL folder?
    How can I find the files in the SMTP service PICKUP folder?
    How can I find the files in the SMTP service QUEUE folder?
    How to change the SMTP banner on Windows 2000
    I am using the IIS Smtp service, how can I get a listing of undelivered messages?

    User Accounts

    How to Change the Display Names of Active Directory Users with Active Directory Services Interface Script
    This article describes how to change the display names of Active Directory users with Active Directory Services Interface (ADSI) script.

    Virtual Directories

    How can I create a virtual directory and create an ASP application root at the same time?
    How can I delete a virtual directory?
    How can I view all virtual directory paths for a web site.

    Web Sites

    How can I create a web site with multiple host headers?
    How can I delete a web site using ADSI?
    How can I determine the number of sites I have such as Web and FTP on my server?
    How can I display the Custom Errors defined for my Site?
    How can I find a web site by Host Header name?
    How can I get a listing of which sites are started or stopped?
    How can I get a simple listing of the web sites and their home directories?
    How can I get a simple listing of the web sites on my Web Server?
    How can I retrieve/display the IIS Application name from a script?
    How can I set my site so it can not be deleted in the MMC?
    How can I set the application protection for a web site?
    How can I view all the web site root directory paths?
    How do I add a new default document to a Web Site?
    How do I change the REALM what is displayed when in a Logon Dialog?
    How do I create a web site, and an FTP site, and a EMAIL, and configure Front Page Server Extensions?
    How do I enable document footers using a script?
    How do I enumerate the physical and virtual folders on a particular IIS web site?
    How do I find the next available Instance ID for a web site in the IIS Metabase?
    How do I make sure that all web sites are running?
    How do I start and stop one web site?
    How do I unload an IIS Application?
    HowTo: Create a virtual directory from an ASP page.
    I manage more than 2000 sites with IIS, how can I tell which sites are running out of process?
    This DLL enables you to install a website and a filter in IIS4 from InstallShield. The DLL uses ADSI and includes the C++ source


    Microsoft Script Repository: Internet Information Server 5.x

    Applications and Application Pools
    Sample scripts for creating, deleting, and modifying application and application pools for Internet Information Server 5.0 and 5.1.

    Basic Administration
    Sample scripts for basic administration (such as backing up and restoring the metabase) of Internet Information Server 5.0 and 5.1.

    Compression
    Sample scripts for managing file compression on Internet Information Server 5.0 and 5.1.

    FTP Sites
    Sample scripts for managing FTP sites on Internet Information Server 5.0 and 5.1.

    Web Sites
    Sample scripts for managing Web sites on Internet Information Server 5.0 and 5.1.

    Microsoft Script Repository: Internet Information Server 6.0

    Applications and Application Pools
    Sample scripts for creating, deleting, and modifying application and application pools for Internet Information Server 6.0.

    Authentication
    Sample scripts for managing authentication properties on Internet Information Server 6.0.

    Basic Administration
    Sample scripts for basic administration (such as backing up and restoring the metabase) of Internet Information Server 6.0.

    BITS Server
    Sample scripts for managing the BITS Server that ships with Internet Information Server 6.0.

    Certificates
    Sample scripts for managing certificate properties on Internet Information Server 6.0.

    Compression
    Sample scripts for managing file compression on Internet Information Server 6.0.

    Filters
    Sample scripts for managing filter properties on Internet Information Server 6.0.

    FTP Sites
    Sample scripts for managing FTP sites on Internet Information Server 6.0.

    IMAP Server
    Sample scripts for managing the IMAP mail server included with Internet Information Server 6.0.

    Logging
    Sample scripts for logs and logging options on Internet Information Server 6.0.

    NNTP Server
    Sample scripts for managing the NNTP news server included with Internet Information Server 6.0.

    POP3 Server
    Sample scripts for managing the POP3 mail server included with Internet Information Server 6.0.

    SMTP Server
    Sample scripts for managing the SMTP mail server included with Internet Information Server 6.0.

    Web Sites
    Sample scripts for managing Web sites on Internet Information Server 6.0.


    IIS - Running multiple web sites *at once* on non-server editions of IIS
    Found on the BlueDragon Blog by Charlie Arehart
     
    Charlie discusses different products that can be used to Run Multiple Web Sites on Windows XP. He describes some products that let you run multiple sites at the same time.
     
    For more details see
    http://bluedragon.blog-city.com/multisitesoniis.htm
     

    IIS - www.iiswebcastseries.com

    You should really visit the Internet Information Services Webcasts home page for some very good details on Security, Performance, Reliability, Scalability, Management, Diagnostics and Deployment of IIS.

    www.iiswebcastseries.com


    IIS FTP - Shared Folders with FTP Isolated Users
    I came across this question on the "microsoft.public.inetserver.ftp" newsgroup today
    I am setting up a FTP site in User Isolation Mode.
    I have FTPRoot as C:\Inetpub\ftproot.
    Under this I have the following phsical directory structure:
    LocalUser
        |- User1
        |- Public

    Both User1 and anonymous can log in fine and are limited to their
    directories (so far so good)

    I have a directory c:\ftp\shared that I want User1 and anon to see under
    their home directories, but I can't seem to setup the virtual directory
    structure correctly.

    I have tried the following in IIS:
    WebSite
        |-LocalUser (VDIR to c:\Inetpub\ftproot\LocalUser)
            |-User1 (VDIR to c:\Inetpub\ftproot\LocalUser\User1)
                |-shared (VDIR to C:\ftp\shared)

    and
    WebSite
        |- User1 (VDIR to c:\Inetpub\ftproot\LocalUser)
            |- shared (VDIR to c:\ftp\shared)

    neither has worked.  I have also tried to setup the LocalUser as a virtual
    directory pointing to some other location (moving the physical directories
    too), but then no user was able to login.

    What is the proper way to do this?
     

    The following is one method to get this to work - I do not know of a better method but this does work

    Lets start with a new FTP Site with nothing in it.

    I start by creating a folder at the following location (you can use any path you want)

    C:\Inetpub\FTPSites\LocalIsolatedShared

    Now you create your FTP site and configure it to use FTP Isolated Users

    So continue with the FTP Site Creation Wizard.

    Now in the home directory folder you must create the following directory "LocalUser" so our path will be:

    C:\Inetpub\FTPSites\LocalIsolatedShared\LocalUser

    Note: In my sample I am doing this on Small Business Server 2003 which is a Domain Controller - this means that instead of using LocalUser I must use the name of my domain which is called IISFAQ

    Now you must create your directories for each user who will access the FTP site.

    In this example I have created a user called XYZ

    so I now create a folder called XYZ inside of the LocalUser or DOMAINNAME folder.

    C:\Inetpub\FTPSites\LocalIsolatedShared\IISFAQ\XYZ

    Create a file in the XYZ folder called XYZ.TXT just so we know we are in the correct place.

    If you test this now with an FTP client you should be able to log on as user XYZ and see the file XYZ.TXT

    We now need to create a folder for the shared documents or files.

     
    We go back to out FTP home directory and create a folder called Shared

    C:\Inetpub\FTPSites\LocalIsolatedShared\Shared

    If this is all we do our Shared folder is not accessible so it does not have any use to us.

    Create a file in the Shared file called Shared.TXT

    We now need to add a virtual directory to the FTP Site.

    • Right click the FTP Site in IIS Manager and select New-Virtual Directory
    • Enter Shared as the Alias and click Next
    • Enter C:\Inetpub\FTPSites\LocalIsolatedShared\Shared as the path and click next
    • Click Next and then click Finish.

    Now although the user will not be able to see this Shared folder they can actually change directory to it. So it is sort of like a hidden directory as can be shown below.

    So  we now have a problem because the Shared virtual directory is there but the user can not see it!

    So how do we get the user to see this virtual directory?

    The only way that I know of is to create a physical folder called "Shared" in the users area.

    So we end up with this path:

    C:\Inetpub\FTPSites\LocalIsolatedShared\IISFAQ\Shared

    Now when the user issues a DIR command they will see a folder called Shared and if they change into the Shared folder they will see the contents not of the physical folder but of the virtual directory folder as can be shown below.

    Note: This means that we have to create a folder called Shared for every FTP user on your site which is not ideal and sort of defeats the purpose of virtual directories but I do not know of another way to perform this action.

    IIS - Application Pool Architecture Interactive Simulation

    I just found this resource today although it has been released since 2003. 

    This interactive demonstration shows how Internet Information Services (IIS) 6.0 manages and monitors Web server functionality. By providing control to administrators and automating various functions, IIS 6.0 helps to keep applications and sites running without reactive administrative supervision.

    Internet Information Services 6.0 - Application Pool Architecture Internet Information Services (IIS) 6.0 utilizes the Application Pool configuration tool to provides administrators with powerful application pool monitoring and management. Health monitoring enables IIS 6.0 to monitor application pools and restart them if a pool fails. Recycling keeps troublesome applications functioning without administrative supervision. Administration also becomes more cost-effective, because performance options, such as idle timeouts, conserve Web server resources, allowing more sites to be hosted on a single server. Rapid fail protection keeps repeatedly failing applications from impacting other sites running on the server.

    To see more http://www.microsoft.com/windowsserver2003/techinfo/training/iis.mspx

    Note: Requires installation of an ActiveX control


    IIS - Server Application Unavailable

    I had a most interesting issue occur this morning on my work pc with IIS 5.1

    Background

    I zipped up a web site I was working on last night and sent it home as an Email message. I then extracted it and worked on it at home without issues. I then used WinRAR to rar it up and sent it back to work. I then extracted the files (by drag & drop from within WINRAR) and went to run the application. I instantly received the following message in my web browser.

    Server Application Unavailable

    The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request.

    Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

    • The message came up instantly as soon as I hit refresh - no delay!
    • There was this message in the Windows Event Log each time I refreshed the page.

      Event ID : 1088, Failed to execute request because the App-Domain could not be created
      Error: 0x80070005 Access is denied

    I did a couple of things most people do in this situation:

    • Performed an IIS Reset - Same problem!
    • Rebooted the PC - Same problem!
    • Verified the services were all working - all ok!
    • Checked the event log again - same messages!

    I then thought about requesting a static file:

    • This worked fine

    I then renamed web.config to web.config1 and copied my original web.config file from the original zip over the current one!

    • The web application was working again

    So I renamed the web.config files around the other way so that the now working web.config was called web.config1

    • Web application was again failing!

    I then checked the permissions on the web.config files

    Caused the Error   Did not cause the error
     

    As you can see from the above permissions there was no permissions defined for the ASP.NET machine account or the IUSR_ and IWAM_ accounts.

    Now more investigating into WinRAR.

    • I had dragged my files from within the WinRAR window to the folder directory without using the Extract To option!

    I assume that this actually extracts the file to a temp folder and then moves the file to the actual folder where it is dragged to. This causes the following scenario.

    • The file is extracted to a temp directory - the file inherits the security settings of that directory
    • The file is then moved to the final directory where I dragged it to - this causes the file to retain the security settings it originally had in the temp folder.

    Using the Extract To option in WinRAR however correctly extracts the file to the correct folder where it inherits the security settings of the folder.

    Just something you should watch out for if you see a similar issue.


    IIS - Using Command-Line Administration Scripts (IIS 6.0)

    You can extend administrative control by using scripts to perform server administration tasks. You can use scripts to automate tasks, remotely administer sites and resources, and take advantage of batch files to create and manage objects. For additional information on using command lines, see the "Command-Line Reference" in Help and Support Center for Windows Server 2003.

    Internet Information Services 6 (IIS 6) contains eight supported command-line scripts that use the IIS Windows Management Instrumentation (WMI) provider to configure and manage IIS metabase configurations. Microsoft supports the command-line scripts that are included in IIS, as long as the scripts are not modified. If you need to modify a supported script, you must save it under a new file name, leaving the original script unmodified.

    For more details see
    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/66cf2a1d-26f4-47f5-b4ff-af4011cdeffb.mspx


    IIS - [Commercial] Attenuate for IIS
    Attenuate is an 'add-on' for Microsoft's Internet Information Server (IIS). Attenuate facilitates the imposition of a variety of bandwidth constraints (throttling) without rejection of service. These include:
    • Total server download rate.
    • Total server upload rate (asp).
    • Individual (connection) upload rate.
    • Rule based assignment of download rate constraints. Rules are specified as wild-card strings. Constraints can be specified as both/either connection or total.

    Examples of use include limiting download rates of .zip and .exe files on a per directory basis, limiting .jpeg and .gif download rates sitewide, and preserving bandwidth where streaming media is used. These techniques permit valuable server capacity to be stretched.

    For more details see http://www.tcpdata.com/att_overview.shtml


    IIS - [Commercial] RADIUS authentication for IIS 6 in native mode

    RADIUS is one of the most widely used distributed security/authentication protocols in use today. It originally gained popularity with ISP's, where it got its name (Remote Authentication Dial In User Service). Because of its inherent architectural advantages, it has become widely used in other network environments, including wireless and the general corporate intranet. The RADIUS client-server architecture provides an open and scalable solution that is broadly supported by a large vendor base. RADIUS provides a widely accepted standard protocol anywhere network access servers (NAS) must authenticate users prior to granting access to a protected network.

    For more details see http://www.tcpdata.com/radiis_overview.shtml


    Preventing Log Evasion in IIS

    One of the most important functions a Web site has is the ability to track who is visiting it, where they are coming from, and what they are doing. While logs themselves may not always be the most accurate measurement of what's going on, they do provide a high level overview useful for tracking common user functions and tasks. There are instances when certain types of data aren't logged such as referrers, cookies, user agents, and POST data. Logging can also be used to track abnormal behavior including malicious requests sent by a potential attacker trying to break into your site. These logs can be extremely valuable in identifying if an attack was successful or not, as well as some of the exact commands that an attacker may have executed.

    For more details see the full article at http://www.webappsec.org/projects/articles/082905.shtml


    ASP.Net Server Control - Dynamic Lookup Edit Control with Popup Window

    Welcome to my ASP.NET Server Control : LookupEditControl. This control uses a number of different technologies to do its magic.

    • Dynamic requests, DHTML, and JavaScript

    There is a lot of talk these days about AJAX but not a lot of source in the edit control stage from what I have found. There is always the Google Suggest discussions but no real code.

    I have written an ASP.Net server control (currently still in development) that does what I need and works quite well, but not 100% well, still more work to do.

    Here are some of the features that I have implemented and currently basically work

    • ASP.Net Server Control
    • Multi Browser Compatible (IE 6, and Firefox 1.04, maybe others?)
    • Supports Multiple Columns in the popup window
    • Supports saving a value that is visible in the Columns just like a DropDownList
    • Supports updating values when you have tabbed off the control, this was for those times when you type too quick and the control is still doing its lookup.
    • Supports defining the width of the Popup Window
    • Supports CSS styles for the columns and the Popup Window
    • Supports Keyboard Up/Down
    • Supports Mouse Selection
    • Popup Window Displays over Select Tags with no bleeding 

    I really am looking for people to help me with this project as I need testers and people with ideas who may be better than me to help clean up the code.

    If you want to see it in action browse to http://code.crowe.co.nz/LookupEditControl/

    Please let me know what you think of this control as I have spent a lot of time and I am quite happy with it but there are issues yet to be fixed.


    IIS - IIS Request Processing

    Ken Schaefer [IIS MVP] has produced a very useful flow chart of how IIS 6 handles requests, this flow chart can be very useful in diagnosing 401 and 403 status codes.

    For more details see Ken's site at http://www.adopenstatic.com/faq/IISRequestProcessing.aspx


    IIS - Creating a secret web site on IIS 5.x using Alternative Data Streams

    Creating a secret web site on IIS 5.x using Alternative Data Streams

    Using a little known feature of the Windows NT file system (NTFS) one can create a secret website, this website can not be detected without third party tools made specifically for it
     
    A NTFS file can contain a number of alternative data streams that bypasses the regular directory listing, the data in the alternative data does not even count when the number of free bytes left on the disk is calculated.
     
    For more details see http://ingehenriksen.blogspot.com/2005/08/creating-secret-web-site-on-iis-5x.html

    IIS - IIS 5.x Folder Traversal with possible DOS through the IDE bus

    IIS 5.x Folder Traversal with possible DOS through the IDE bus

    It is possible to trick the URL validation in IIS 5.x that results in touching of files outside the virtual folders. I suggest in this article that this *could* cause a DOS if flooding a device with file access calls, more specifically on IDE disk systems where the System Drive HD shares the IDE bus with device A:\ or B:\.
    For a complete technical description of the problem see Inge Henriksen's blog
    http://ingehenriksen.blogspot.com/2005/08/iis-5x-folder-traversal-with-possible.html

    IIS - Remote IIS 5.x and IIS 6.0 Server Name Spoof

    Remote IIS 5.x and IIS 6.0 Server Name Spoof

    It is possible to remotely spoof the "SERVER_NAME" Microsoft® Internet Information Server® 5.0, 5.1 and 6.0 server variable by doing a modified HTTP request. Thus potentially revealing sensitive ASP code through the IIS 500-100.asp error page, the spoof also opens up a potential range of exploits in third party web applications and web services.
     
    For a complete technical description of the problem see Inge Henriksen's blog
    http://ingehenriksen.blogspot.com/2005/08/remote-iis-5x-and-iis-60-server-name.html
     

    IIS - HTTP Status Codes

    When you are checking your IIS log files you can find a field which defines the status of the request. This status can be very useful when you are trying to diagnose a problem such as a user being denied access to your site.

    An example from a W3Extended log file format containing 2 log entries from Windows XP Professional

    #Software: Microsoft Internet Information Services 5.1
    #Version: 1.0
    #Date: 2005-08-26 18:19:49
    #Fields: date time c-ip cs-username s-sitename s-computername s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status sc-win32-status sc-bytes cs-bytes time-taken cs-version cs-host

    2005-08-26 18:19:49 127.0.0.1 - W3SVC1 CHRIS 127.0.0.1 80 GET /images/ - 302 0 285 586 62 HTTP/1.1 localhost
    2005-08-26 18:19:49 127.0.0.1 - W3SVC1 CHRIS 127.0.0.1 80 GET /images/ - 403 5 334 587 16 HTTP/1.1 localhost

    From the above log entries we can see we have a status of 302 (Object moved) for the first request, and a status of 403 (Forbidden) for the second request. But we do not know why the user was denied access. In this case I tried to browse an image directory and it did not have directory browsing enabled which should have logged a 403.14 error but IIS 5.1 and earlier do not support storing the sub status code.

    Doing something similar with IIS 6 on Windows 2003 Server we get these log file entries.

    #Software: Microsoft Internet Information Services 6.0
    #Version: 1.0
    #Date: 2005-08-26 00:03:26
    #Fields: date time s-sitename s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes
    2005-08-26 18:33:30 W3SVC68783193 SBS2003 192.168.2.2 GET /images - 80 - 192.168.2.1 HTTP/1.1 301 0 0 399 432
    2005-08-26 18:33:30 W3SVC68783193 SBS2003 192.168.2.2 GET /images/ - 80 - 192.168.2.1 HTTP/1.1 403 14 5 412 433

    In the IIS 6 log file example above you can see that I am logging two status fields sc-status and sc-substatus

    This time the first request is returning a status of 301 (Object Moved Permanently) and a sub status of 0 which is not used.
    The second request returns a status of 403 (Forbidden) and a sub status of 14 (Directory Listing Denied)

    1xx - Informational

    These status codes indicate a provisional response. The client should be prepared to receive one or more 1xx responses before receiving a regular response.

    100 - Continue.
    101 - Switching protocols.
     

    2xx - Success

    This class of status codes indicates that the server successfully accepted the client request.

    200 - OK. The client request has succeeded.
    201 - Created.
    202 - Accepted.
    203 - Non-authoritative information.
    204 - No content.
    205 - Reset content.
    206 - Partial content.
     

    3xx - Redirection

    The client browser must take more action to complete the request. For example, the browser may have to request a different page on the server or repeat the request by using a proxy server.

    301 - Moved Permanently
    302
    - Object moved Temporarily
    303 - See Other
    304 - Not modified.
    307 - Temporary redirect.
     

    4xx - Client Error

    An error occurs, and the client appears to be at fault. For example, the client may request a page that does not exist, or the client may not provide valid authentication information.

    400 - Bad request.
    401 - Access denied. IIS defines a number of different 401 errors that indicate a more specific cause of the error. These specific error codes are displayed in the browser but are not displayed in the IIS log:

    401.1 - Logon failed.
    401.2 - Logon failed due to server configuration.
    401.3 - Unauthorized due to ACL on resource.
    401.4 - Authorization failed by filter.
    401.5 - Authorization failed by ISAPI/CGI application.
    401.7 – Access denied by URL authorization policy on the Web server. This error code is specific to IIS 6.0.

    403 - Forbidden. IIS defines a number of different 403 errors that indicate a more specific cause of the error:

    403.1 - Execute access forbidden.
    403.2 - Read access forbidden.
    403.3 - Write access forbidden.
    403.4 - SSL required.
    403.5 - SSL 128 required.
    403.6 - IP address rejected.
    403.7 - Client certificate required.
    403.8 - Site access denied.
    403.9 - Too many users.
    403.10 - Invalid configuration.
    403.11 - Password change.
    403.12 - Mapper denied access.
    403.13 - Client certificate revoked.
    403.14 - Directory listing denied.
    403.15 - Client Access Licenses exceeded.
    403.16 - Client certificate is untrusted or invalid.
    403.17 - Client certificate has expired or is not yet valid.
    403.18 - Cannot execute requested URL in the current application pool. This error code is specific to IIS 6.0.
    403.19 - Cannot execute CGIs for the client in this application pool. This error code is specific to IIS 6.0.
    403.20 - Passport logon failed. This error code is specific to IIS 6.0.

    404 - Not found. 404.0 - (None) – File or directory not found.

    404.1 - Web site not accessible on the requested port.
    404.2 - Web service extension lockdown policy prevents this request.
    404.3 - MIME map policy prevents this request.
    404.4 - No Handler (IIS 7)
    404.5 - Request Filtering: URL Sequence Denied (IIS 7)
    404.6 - Request Filtering: Verb denied (IIS 7)
    404.7 - Request Filtering: File extension denied (IIS 7)
    404.8 - Request Filtering: Denied by hidden namespace (IIS 7)
    404.9 - Denied since hidden file attribute has been set (IIS 7)
    404.10 - Request Filtering: Denied because request header is too long (IIS 7)
    404.11- Request Filtering: Denied because URL doubled escaping (IIS 7)
    404.12 - Request Filtering: Denied because of high bit characters (IIS 7)
    404.13 - Request Filtering: Denied because content length too large (IIS 7)
    404.14 - Request Filtering: Denied because URL too long (IIS 7)
    404.15- Request Filtering: Denied because query string too long (IIS 7)

    405 - HTTP verb used to access this page is not allowed (method not allowed.)
    406 - Client browser does not accept the MIME type of the requested page.
    407 - Proxy authentication required.
    412 - Precondition failed.
    413 – Request entity too large.
    414 - Request-URI too long.
    415 – Unsupported media type.
    416 – Requested range not satisfiable.
    417 – Execution failed.
    423 – Locked error.
     

    5xx - Server Error

    The server cannot complete the request because it encounters an error.

    500 - Internal server error.

    500.12 - Application is busy restarting on the Web server.
    500.13 - Web server is too busy.
    500.15 - Direct requests for Global.asa are not allowed.
    500.16 – UNC authorization credentials incorrect. This error code is specific to IIS 6.0.
    500.18 – URL authorization store cannot be opened. This error code is specific to IIS 6.0.
    500.100 - Internal ASP error.

    501 - Header values specify a configuration that is not implemented.
    502 - Web server received an invalid response while acting as a gateway or proxy.

    502.1 - CGI application timeout.
    502.2 - Error in CGI application.

    503 - Service unavailable. This error code is specific to IIS 6.0.
    504 - Gateway timeout.
    505 - HTTP version not supported.
     

    For more details see these resources :


    IIS - Upcoming Webcasts

    Below is a list of the upcoming IIS Web Casts from Microsoft. These are well worth attending so that you can learn from the IIS Program Managers

    An Application Security Administration Model for Distributed ASP.NET Applications: An IIS-Centric View—Part 1
    September 20, 2005—11:00 a.m. PT

    An Application Security Administration Model for Distributed ASP.NET Applications: An IIS-Centric View—Part 2
    September 28, 2005—11:00 a.m. PT

    Automate, Automate, and More Automate: Scripting IIS 6.0
    October 11, 2005—11:30 a.m. PT

    Deciphering the Tools of the Trade: A Review of IIS Stress Testing Toolsets
    October 27, 2005—11:30 a.m. PT

    Finding IIS Bottlenecks Using Server Performance Advisor
    November 08, 2005—11:30 a.m. PT

    Using Host Headers with SSL-Enabled Web Sites in IIS 6.0 with Windows Server 2003 Service Pack 1
    November 29, 2005—11:30 a.m. PT

    Using the Security Configuration Wizard Effectively with IIS 6.0 and Windows Server 2003 and Service Pack 1—Part 1
    December 07, 2005—11:00 a.m. PT

    Using the Security Configuration Wizard Effectively with IIS 6.0 and Windows Server 2003 and Service Pack 1—Part 2
    December 14, 2005—11:00 a.m. PT

    For more details see http://www.microsoft.com/windowsserver2003/iis/support/webcasts.mspx


    Log Parser - Different Output Formats available

    In this blog entry we will display the same output in a number of different formats that Log Parser is capable of providing.

    Default

    Using the default output format the results are displayed inside of the command prompt.

    SELECT top 25 distinct c-ip as ClientIP, Count(*) as Hits
    FROM \\sbs2003\LogFiles\W3SVC68783193\ex0508*.log
    group by c-ip
    order by Hits, c-ip desc


    Command Line

    LogParser.exe file:distinctclientrequests.sql

    Output

    Notice in the above listing you get a "Press a key..." displayed you can turn this off if you use the -rtp:-1 switch

    Chart

    Using an output format of a chart you can create nice graphs of log entries

    SELECT top 25 distinct c-ip as ClientIP, Count(*) as Hits
    into test.gif
    FROM \\sbs2003\LogFiles\W3SVC68783193\ex0508*.log
    group by c-ip
    order by Hits, c-ip desc


    Command Line

    LogParser.exe file:distinctclientrequests.sql -view

    Output

    The output in this case is a file on disk called test.gif. and the -view parameter displays it in a window.


     

    DataGrid

    Using an output format of a DataGrid you can view the results inside of a grid which is a lot easier for viewing the results in certain circumstances.

    SELECT top 25 distinct c-ip as ClientIP, Count(*) as Hits
    into DATAGRID
    FROM \\sbs2003\LogFiles\W3SVC68783193\ex0508*.log
    group by c-ip
    order by Hits, c-ip desc


    Command Line

    LogParser.exe file:distinctclientrequests.sql

    Output


    LogParser - How to retreive the log filename where a LogFileEntry is from.

    When using Log Parser you may want to include the log file name that the client data was extracted from. If you are using the W3C format you can do this with the LogFilename input field which will return the full path to the log filename that contains the row of data.

    Save the data below as distinctclientrequests.sql

    SELECT top 25 distinct LogFilename, c-ip as ClientIP, Count(*) as Hits
    FROM \\sbs2003\LogFiles\W3SVC68783193\ex0508*.log
    group by c-ip, LogFilename
    order by Hits, c-ip desc

    Command Line

    LogParser.exe file:distinctclientrequests.sql

    Example Output:

    LogFilename ClientIP Hits
    \\sbs2003\LogFiles\W3SVC68783193\ex050819.log 192.168.2.1 2791
    \\sbs2003\LogFiles\W3SVC68783193\ex050809.log 192.168.2.1 2296
    \\sbs2003\LogFiles\W3SVC68783193\ex050807.log 218.101.54.21 2262
    \\sbs2003\LogFiles\W3SVC68783193\ex050806.log 192.168.2.1 1967
    \\sbs2003\LogFiles\W3SVC68783193\ex050811.log 192.168.2.1 1838
    \\sbs2003\LogFiles\W3SVC68783193\ex050808.log 218.101.54.21 1744
    \\sbs2003\LogFiles\W3SVC68783193\ex050810.log 192.168.2.1 1441
    \\sbs2003\LogFiles\W3SVC68783193\ex050804.log 218.101.54.21 1372
    \\sbs2003\LogFiles\W3SVC68783193\ex050811.log 218.101.54.21 1243
    \\sbs2003\LogFiles\W3SVC68783193\ex050824.log 192.168.2.1 965

    If you are wanting to only get the log filename and not the full path you could use the following query:

    Save the data below as distinctclientrequests.sql

    SELECT top 25 distinct EXTRACT_FILENAME(LogFilename) as LogFile, c-ip as ClientIP, Count(*) as Hits
    FROM \\sbs2003\LogFiles\W3SVC68783193\ex0508*.log
    group by c-ip, LogFile
    order by Hits, c-ip desc

    Command Line

    LogParser.exe file:distinctclientrequests.sql

    Example Output:

    LogFile ClientIP Hits
    ex050819.log 192.168.2.1 2791
    ex050809.log 192.168.2.1 2296
    ex050807.log 218.101.54.21 2262
    ex050806.log 192.168.2.1 1967
    ex050811.log 192.168.2.1 1838
    ex050808.log 218.101.54.21 1744
    ex050810.log 192.168.2.1 1441
    ex050804.log 218.101.54.21 1372
    ex050811.log 218.101.54.21 1243
    ex050824.log 192.168.2.1 965


    IIS - Using WMI and VBScript to Change HTTP Compression Settings in IIS 6

    I found an interesting piece of code online for adjusting the IIS compression settings in IIS 6 using WMI and VBScript on WindowsITPro - although you must be a registered user you can download the code.

    See http://www.windowsitpro.com/WindowsScripting/Article/ArticleID/44335/44335.html

    Or just incase the code is gone click here


    IIS - Creating Web Sites and AppPools using WMI ( C# sample code )

    I came across a very good example of creating Web Sites with custom App Pools in c# using WMI by a guy called Ramesh Raman's who has a blog at MSDN blogs. It it appears he no longer updates it since the last entry is dated July, 2004

    He had an example of using the WMI Provider and XML to create a new web site with a complete description of the process of each step taken:

    Using the WMI Provider to Configure IIS 6.0 - A Data Driven Approach
    http://blogs.msdn.com/ramesh_r/archive/2004/03/24/95109.aspx

    For just the code (which was updated to include the creation of App Pools and Virtual Directories) see:

    http://blogs.msdn.com/ramesh_r/articles/170665.aspx

    For a copy of the code click here (just incase it disappears) - please note you should right click and save-as as you can not view it as IE will try to render it as XML and fail (although you can then do a view-source to see the code)


    IIS Help contents do not function after security updates are applied in Windows XP

    If you have a fully patched Windows XP Service Pack 2 machine and you try to browse the IIS Help virtual directory in the default web site you will notice that it no longer displays as is shown below.

    The reason why this happens is that there was a vulnerability in the way Internet Explorer was showing HTML Help files which cause malicious code to run on your computer.

    This is discussed in the Microsoft Security Bulletin:

    MS05-026: A vulnerability in HTML Help could allow remote code execution
    http://support.microsoft.com/kb/892675/

    Microsoft engineers though about this issue of web sites using HTML help not working on the client and produced a workaround which involves editing the registry on the local client computer.

    To implement this registry change so you can see the IIS HELP online you will need to perform the following:

    • Open the Windows Registry Editor (regedit.exe)
    • Navigate to the following key:

      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x
       
    • You then need to create a new key called "HHRestrictions"
    • You then need to add a new string value called "UrlAllowList"
    • You then need to give it a value of :

      C:\WINDOWS\Help\iisHelp\iis\misc;http://localhost/iishelp

      Note: there is a semi-colon between the two paths above

    The resulting actions can be seen in the screen snap below.

     

    For more details on this procedure and other options such as implementing this on a domain see the following article:

    Certain Web sites and HTML Help features may not work after you install security update 896358 or security update 890175
    http://support.microsoft.com/kb/892675/

    After you perform the above you will be able to use the HTML Help control which is used by the IISHELP virtual directory but another security feature will make all of the links in the help open in the same frame as the contents.

     

    After you install security update 896358, content that should be displayed in a different frame is displayed in the frame that contains the HTML Help ActiveX control
    http://support.microsoft.com/kb/896905/


    Debugging IIS Crash/Hang situations with IIS State

    Often the most effective way to diagnose the root cause of an IIS Crash or Hang situation is to use a debugging tool that allows you to look inside the various processes that IIS uses (such as dllhost.exe or w3wp.exe). Whilst diagnostic tools like AuthDiag and SSLDiag can help solve configuration issues which are preventing your IIS Server from running properly, a crash or hang usually is caused by faulty code, hardware issues, or problems connecting to remote resources (e.g. a remote database server), and these problems may not deterministically manifest themselves.

    For a step by step guide to setup and using IIS State please see the following article:

    http://www.adopenstatic.com/faq/IISConfigureIISState.aspx


    IIS - ISAPI Filter - [Commercial] Port 80 HttpZip

    HTTP compression is a safe, powerful, and affordable way to speed up Web sites and applications from 2.5 to 50 times faster while reducing bandwidth costs.

    httpZip is an IIS server module for ISAPI-based compression on IIS 4, 5, and 6.0 Web servers. The software compresses static and dynamic Web content using encoding algorithms supported by all modern browsers, with flawless decompression secured by real-time browser compatibility checking.

    Detailed httpZip reporting shows your files reduced to as little as 2% of their original size! httpZip takes compression even farther with optional HTML and CSS code optimization to improve performance and combat hackers' source sifting. With httpZip's built-in caching feature, static and dynamic files can be accessed in pre-compressed format to minimize recompression processing. The result is faster, more efficient page loads, happier users, reduced transmission costs, and Web servers that can handle more volume!

    Current cost for a Single Serfver (unlimited domains) as of August 2005 is $350 USD

    You can also perform a live check on your site to determine what % compression you may get from their web site. The comparision below was done on my blog in August 2005 and can show the potential that compression can have on your pages.

    File Size Comparison (in bytes):
    Original size: 61559 bytes
    Size if compressed: 14920 bytes
    Possible savings in bytes: 46639 bytes
    Percentage saved by compression: 76.0%
    Transfer speed improvement: 4.1 X

    For more details see - http://www.port80software.com/products/httpzip


    IIS - [Freeware] IIS Metabase Explorer 1.1
    All versions of IIS store their configuration in a special database called the metabase. The metabase is in some ways similar to the Windows Registry. Unlike the Windows Registry Editor IIS has no built in tools to view, change or track activity in the Metabase.
     

    The IIS Metabase Explorer allows you to view the hierarchical structure of the metabase, edit the hierarchy or data values, copy or move data from one key to another, backup and restore the database and track changes made to the metabase by any application running on your system. The best thing about the IIS Metabase Explorer is that it is FREE.

  • NEW for 1.1: Embedded MSDN and localised Google help (available in English, French, Italian, German, Spanish, Portuguese and Russian).
  • View and edit the metabase hierarchy and key data.
  • Copy and move data around the metabase.
  • View global metabase activity in the trace window.
  • Backup and restore the metabase with encryption (where available).
  • Compatible with IIS 4.x through to IIS 6.x.
  • Runs on Windows 98/Me/NT4/2000/XP/2003. You should also have at least IE 5.0 installed.
  • For more details see - http://www.ripcordsoftware.com/IISMetabaseExplorer/index.htm


    IIS - ISAPI Filter - [Commerial] IISxpress Compression 1.1
    IISxpress is a powerful and highly configurable compression plug-in for IIS, the industry standard web server for the Windows platform. IISxpress will significantly reduce the bandwidth requirements of your web site, reducing your costs and giving your users the best web browsing experience possible.

    IISxpress is ideally suited for deployment on Internet facing web servers, corporate intranet web servers in a WAN/LAN environment and for home users running a web site on an low bandwidth connection (ADSL or cable)

    • Control your compression settings by file type, content type, URI (virtual directory) and IP address.
    • View in real-time your server's performance; monitor CPU usage, memory usage and compression effectiveness.
    • Compatible with all major browsers: Internet Explorer, Mozilla, Firefox, Opera and Safari.

    Cost as of August 2005 was $50 USD

    For more details see - http://www.ripcordsoftware.com/IISxpress/index.htm


    IIS - Logging - W3 Extended Logging Format - the refeering web site is not included by default

    To customize W3C Extended logging to include the Referer follow these steps

    1. In IIS Manager, expand the local computer, expand the Web or FTP Sites folder, right-click the Web or FTP site, and click Properties.
    2. On the Web or FTPSite tab, select the Enable logging check box (if it is not already selected).
    3. In the Active log format list box, click W3C Extended Log File Format.
    4. Click Properties.
    5. On the Advanced tab, tick the check box next to the item called Referer
    6. Click OK.
    7. Click OK.

    When the referer is included in the log files you can analyze the logs to include details on how people arrived at your site which is a very good metric to report on.


    IIS - ODBC Logging can reduce your system performance on IIS 6+

    ODBC logging format is a record of a fixed set of data properties in a database that complies with Open Database Connectivity (ODBC), such as Microsoft Access or Microsoft SQL Server™. Some of the items logged include the user's IP address, user name, request date and time (recorded as local time), HTTP status code, bytes received, bytes sent, action carried out (for example, a download carried out by a GET command), and the target (for example, the file that was downloaded). With ODBC logging, you must both specify the database to be logged to, and set up the database to receive the data.

    When ODBC logging is enabled, IIS disables the kernel-mode cache. For this reason, implementing ODBC logging can degrade overall server performance.

     Important For security reasons, do not use the SQL SA account for ODBC logging. If a malicious user were to access the worker process, they could use the SA account to access the SQL server. Instead, remove the SQL SA account and create a new account with the least necessary permissions.

    To use ODBC logging

    Create a database containing a table with the appropriate properties for the logging data. IIS includes an SQL template file that can be run in an SQL database to create a table that accepts log entries from IIS. The file is named Logtemp.sql and is located at systemroot\System32\Inetsrv if you accepted the setup defaults.

    The following properties are required in the table you create.

    Field name Data type Description
    ClientHost varchar(255) Client IP address
    Username varchar(255) Client domain name
    LogTime datetime Connection date and time
    Service varchar(255) Internet Information Services (IIS) service
    Machine varchar(255) Computer name
    ServerIP varchar(50) Server IP address
    ProcessingTime integer Processing time in milliseconds
    BytesRecvd integer Bytes received by server
    BytesSent integer Bytes sent by server
    ServiceStatus integer Simple Mail Transfer Protocol (SMTP) protocol reply code
    Win32Status integer Windows Server 2003 status or error code (a 0 value indicates success)
    Operation varchar(255) SMTP protocol command
    Target varchar(255) Recipient
    Parameters varchar(255)

    • Give the database a system Data Source Name (DSN), which is a name that the ODBC software uses to find the database.
    • Supply IIS with the name of the database and table. If a user name and password are needed for accessing the database, you must also specify these in IIS.

    IIS - Scripts - WMI - Enumerate all virtual directories on the local server

    The following script will allow you to enumerate the names of the Virtual Directories on the current machine.

    Save the following script to a .VBS file extension and execute using the following from a CMD.exe prompt.

    cscript MyScript.vbs

    Dim IISObj, strQuery, Item
    
    Set IISObj = GetObject("winmgmts://./root/MicrosoftIISv2")
    strQuery = "SELECT * FROM IIsWebVirtualDir" 
    For Each Item In IISObj.ExecQuery(strQuery)
      WScript.echo Item.Name
    Next

    Example Output

    W3SVC/1/ROOT
    W3SVC/1/ROOT/_vti_bin
    W3SVC/1/ROOT/Backup
    W3SVC/1/ROOT/CertControl
    W3SVC/1/ROOT/CertEnroll
    W3SVC/1/ROOT/CertSrv
    W3SVC/1/ROOT/ClientHelp
    W3SVC/1/ROOT/ConnectComputer
    W3SVC/1/ROOT/Exadmin
    W3SVC/1/ROOT/Exchange
    W3SVC/1/ROOT/exchange-oma
    W3SVC/1/ROOT/ExchWeb
    W3SVC/1/ROOT/ExchWeb/bin
    W3SVC/1/ROOT/ExchWeb/bin/auth
    W3SVC/1/ROOT/ExchWeb/bin/spell
    W3SVC/1/ROOT/IssueVisionDeployWebCS
    W3SVC/1/ROOT/IssueVisionWebCS
    W3SVC/1/ROOT/Microsoft-Server-ActiveSync

    IIS - Scripts - WMI - Enumerate Application Pools on Local Machine

    The following script will allow you to enumerate the Names of the Application Pools on the current machine.

    Save the following script to a .VBS file extension and execute using the following from a CMD.exe prompt.

    cscript MyScript.vbs

    Dim locatorObj, ProviderObj, Pools, strQuery
    
    Set locatorObj = CreateObject("WbemScripting.SWbemLocator")
    Set ProviderObj = locatorObj.ConnectServer(".", "root/MicrosoftIISv2")
    
    strQuery = "Select * from IIsApplicationPool"
    For Each Item In ProviderObj.ExecQuery(strQuery)
        WScript.Echo Replace(Item.Name, "W3SVC/AppPools/", "")
    Next
    


    Example Output

    DefaultAppPool
    ExchangeApplicationPool
    ExchangeMobileBrowseApplicationPool
    MSSharePointAppPool
    MyWineCellar
    StsAdminAppPool
    WMS App Pool
    Blog.crowe.co.nz


    IIS - Port 80 Software - HTTP Inspection Tools of Note

    Please note - Stolen from http://www.port80software.com/200ok/archive/2005/06/15/606.aspx but I thought you would like to read and it is really for me to read when I need a HTTP Inspection tool which is like everyday.

    Some of the tools are implemented as proxies, allow rewriting of headers and all sort of fun stuff, while others plug-in to the browser and monitor the requests passively.  While folks may know of LiveHeaders for Mozilla (http://livehttpheaders.mozdev.org) or HttpWatch for IE (http://www.httpwatch.com), here are a few more that we have found varying in price and capabilities.
     

    Stuck in the middle with you -- a few proxies:

    Fiddler
    http://www.fiddlertool.com/fiddler
    We quite like this proxy, which is being updated all the time.

    HTTPCatcher
    http://www.httpcatcher.com
    A Java-based HTTP proxy to see full headers -- and change ‘em on the fly.

    Charles
    http://www.xk72.com/charles/index.html
    Another Java-based HTTP inspection proxy.
     
     
    Toolbars!  Toolbars!  Get your HTTP toolbars here!:
     
    IE Inspector - HTTP Analyzer
    http://www.ieinspector.com
    Similar to the popular HttpWatch but cheaper -- the DOM inspector though is much more interesting...

    HTTPLook  
    http://www.httpsniffer.com/index.htm
    Interesting integration with the specification to show you header information and decent filtering.

    HttpDetect
    http://www.effetech.com/sniffer
    This is a packet sniffer that can see all the HTTP stuff going on – on your box.  When you need a powertool, Bob Villa-style.
     
    IEWatch
    http://www.iewatch.com
    Yet another IE plug-in -- is there a pattern of free tools emerging here?

    ieHTTPHeaders 
    http://www.blunck.info/iehttpheaders.html
    Yet another IE plug-in -- but this one is FOSS for the budget-minded (free and open, baby).
     
    We even have our own internal tool (httpScope) that we use internally.  It may one day be released at a Port80 near you…

    Cheers,
    Port80ians

    ps: Sorry I know I should link to your article but it was such a good list that I wanted it for myself so the next time I forget I can refer to it. At least I am giving credit where it is due!

    Another great free tool is Ethereal - which is a full packet sniffer - a tool I use all time - for more details see - http://www.ethereal.com/

    Also see this article (although it is now a bit dated - it does show you what you need to know) which describes what you can do with Ethereal - http://iisfaq.com/Default.aspx?tabid=2976


    IIS - ISAPI Filter - [Freeware] ISAPI Rewrite Filter

    Apache has mod_rewrite, which allows URL rewriting. A URL like http://foo/bar/bam can be translated into http://foo/baz/bam.jsp or http://foo/baz/bam.php or ... anything!

    ASP.NET has a URL mapping mechanism, but it works only for filetypes that are handled by ASP.NET: aspx, ascx, asmx, and so on. For static files or non-ASP.NET files, (xml, gif, jpg, css), the ASP.NET mapping won't work cleanly.

    IIS, like Apache's HTTP server, has an extension mechanism: it is called the ISAPI filter. There are commercial ISAPI filters that endow IIS with the ability to re-write URLs. This is my own, small, URL rewriting ISAPI filter.

    • It is implemented in C
    • Not implemented with MFC
    • compiles with VS2003 or with the (free) MS VC++ 2003 toolkit.
    • Rewrite rules are specified using regular expressions (provided by the PCRE library).
    • open source, BSD-style license
    • works with IIS5 (not tested with IIS6)

    For more details see - http://cheeso.members.winisp.net/examples.aspx#Misc


    IIS - ISAPI Filter - [Commerical] - Ionic's ISAPI Rewriting Filter 1.0.1
    Apache has mod_rewrite; now IIS has a small, cheap (free) rewriting module:
     
    Ionic's ISAPI Rewriting Filter (IIRF).
     
    Specify rewrite rules using regular expressions.
     
    An incoming URL like http://foo/bar/bam can be translated into http://foo/baz/bam.jsp or http://foo/baz/bam.php.
     
    ASP.NET has a URL mapping mechanism, but it works only for filetypes that are handled by ASP.NET: aspx, ascx, asmx, and so on.
     
    For static files or non-ASP.NET files, (XML, GIF, JPEG, CSS), the ASP.NET mapping won't work cleanly.
     
    IIS, like Apache's HTTP server, has an extension mechanism: it is called the ISAPI filter.
     
    There are commercial ISAPI filters that endow IIS with the ability to re-write URLs. This is a cheap and powerful alternative.
     
    The comments insply free and cheap - they sort of don't normally go together so it is hard to know - no publisher site was found.
     
     

    IIS - ISAPI Filter - [Commerical] OpUrl - ISAPI URL Rewrite

    An ISAPI filter that provides powerful, integrated URL re-writing for IIS.

    OpUrl has many benefits, including helping to ensure search engines crawl even the dynamic parts of your site.

    Most search engine crawlers don't index dynamic pages, e.g. page.asp?item=1 so OpUrl allows you to use static URLs instead.

    The functionality is very similar to Apache's mod_rewrite.

    Pricing at August 2005 was £29

    For more details see - http://www.opcode.co.uk/components/rewrite.asp


    IIS - ISAPI Filters [Commercial] ISAPI ReWrite

    ISAPI_Rewrite is a powerful URL manipulation engine based on regular expressions. It acts mostly like Apache's mod_Rewrite, but is designed specifically for Microsoft's Internet Information Server (IIS). ISAPI_Rewrite is an ISAPI filter written in pure C/C++ so it is extremely fast. ISAPI_Rewrite gives you the freedom to go beyond the standard URL schemes and develop your own scheme.

    What you can do with ISAPI_Rewrite:

    • Optimize your dynamic content like forums or e-stores to be indexed by a popular search engines.
    • Block hot linking of your data files by other sites.
    • Develop a custom authorization scheme and manage access to the static files using custom scripts and database.
    • Proxy content of one site into directory on another site.
    • Make your Intranet servers to be accessible from the Internet by using only one Internet server with a very flexible permissions and security options.
    • Create dynamic host-header based sites using a single physical site.
    • Create virtual directory structure of the site hiding physical files and extensions. This also helps moving from one technology to another.
    • Return a browser-dependent content even for static files.

    And many other problems could be solved with the power of the regular expression engine built into the ISAPI_Rewrite.

    ISAPI_Rewrite Full

    This is complete version of ISAPI_Rewrite; pricing is $69 USD for a single web server, or $49 USD for ISA server.

    It has the following features:

    • Regular expressions-based URL rewriting engine.
    • Support for global per-server configuration file
    • Support for per-virtual-site configuration files
    • In-memory configurations cache
    • Automatic deletion of rarely-used configurations from memory
    • Monitoring of configuration files and metabase changes and dynamic configuration reload

    ISAPI_Rewrite Full is distributed as try-before-you-buy. You can download a 30-day trial copy for free.

    ISAPI_Rewrite Lite

    This is simplified edition of ISAPI_Rewrite. It does not support per-virtual-site configurations, proxiing, metabase monitoring and automatic cache cleanup but all other features are supported. ISAPI_Rewrite Lite is completely FREE! It may be an ideal solution for the server hosting the only site, development or testing purposes.

    For more details see - http://www.isapirewrite.com/


    IIS - ISAPI Filters - [Commercial] IIS Rewrite

    IISRewrite is a rule-based rewriting engine that allows a webmaster to manipulate URLs on the fly in IIS.

    URLs are rewritten before IIS has handed over the request to be processed, so requests for HTML files, graphics, program files, and even entire directory structures can be rewritten before they are passed to ASP scripts for processing.

    IISRewrite was written to solve some practical problems that are nearly impossible to solve with IIS and ASP. It solves the compatibility issues when doing dynamic downloads with ASP, it allows portions of dynamic sites to be indexed by search engines as if they were static HTML files, and can provide a way to customize web sites based on the client's browser type without the use of Javascript.

    IISRewrite version 1.2: $199.00 per server although they are saying you can buy for $99 as of August 2005

    For more details see - http://www.qwerksoft.com/products/iisrewrite/

     


    IIS - ISAPI Filter - [Freeware] URL Replacer

    The ISAPI filter rewrites/replaces defined parts of URL from browser. It enables url to scripts (.asp, .cgi, .idc) with parameters that look like static html pages or specify exact download filename generated by script.

    You can also create a simple proxy server with IIS and any script engine (.asp,. aspx, …) using URL replacer

    You can configure the filter by http.

    For more details see - http://www.motobit.com/help/url-replacer-rewriter/iis-mod-rewrite.asp


    IIS - ISAPI Filters [Freeware/Shareware] Enhanced Log for Microsoft IIS

    Replaces the standard IIS error message (HTTP/1.0 404 Not Found, HTTP/1.0 401 Access denied, etc.) by custom HTML or HTTP message

    The custom message can be defined for whole web site, or for any file or directory of the web. The message can contains redirection to the another site too.

    You are free to use and distribute EnhancedLog. EnhancedLog signs every custom error message by refrerence to the PSTRUH Software home page. You are not allowed to change the sign in free version of EnhacedLog. You must register to remove the sign.

    For more details see - http://www.pstruh.cz/el/enhlog.asp


    IIS - ISAPI Filers [Commerical] HttpLog ISAPI Filter

    The ISAPI filter enables http raw data logging. Lets you log http header and document data to separate files, monitor IIS service output and check other filters (asp/cgi pages, ISAPI applications) functionality.

    This product has not been updated since 2000 but may still have use for administrators.

    For more details see - http://www.motobit.com/help/httplog/default.htm


    IIS - ISAPI Filters - [Freeware] IISStatus

    IISStatus links into the web server as an ISAPI filter to record each request, including ASP pages, as it is received and processed by the server.

    Use this tool to monitor exactly what your ASP pages are doing and reduce time spent debugging. IISStatus is a Freeware product at this time. In future, we will be releasing enchanced versions of IISStatus although these releases may not be freeware (still freeware after 3 years)

    For more details see - http://www.alchemy.co.nz/products/products_6.html


    IIS - ISAPI Filters - [Free & Commerial] ~Home ISAPI Filter

     

    ~Home is an ISAPI filter dll that will map a URL request that specifies a ~username to the user's home directory. The home directory is defined in the User Manager.

    The home directory can be anywhere:

    • On the same drive as your web root
    • On a different drive from your web root
    • On a different computer from your webroot

    For example let's say that your web root is c:\webroot\ and there is a user named "Joel" who has his home directory in e:\homedir\joelhome\ and he has a home page called home.htm in his home directory. You could access his homepage (assuming permissions have been correctly applied) with:

    http://www.yourserver.com/~joel/home.htm

    There are two versions of this control available:

    The advanced version supports the following additional settings and more:

    • The user's home directory
    • The user's profile directory
    • The user's logon script directory
    • A directory specified by the administrator
    • A directory based on the userid

    For more details see - http://www.roth.net/ISAPI/Home/


    IIS - ISAPI Filter - [Commerical] User Directories for IIS

    User Directories for IIS is an IIS ISAPI Filter DLL that web enables your Windows user accounts. This functionality has long been available on UNIX platforms and now it is available for the IIS web server.

    A home directory is accessed using a URL similar to this:

    http://servername/~username/default.asp

    Note the '~' operator denotes a reference to a user account.

    For more details see - http://www.dashtech.com/products/userdir/


    Custom Property Page for Active Directory User and Computers to manage IIS FTP Home Directories and FTP Root Directories

    I have been working on a C++ project to create a new property page that will show up in Active Directory Users & Computers when you view the properties of a user account. This new property page will allow you to edit the FTP Root (msIIS-FTPRoot) and FTP Directory (msIIS-FTPDir) for users so that if you have configured the IIS FTP Service to run using Active Directory Isolation Mode you can simply use the GUI to view or modify these attributes.

    For more details on these Active Directory attributes see the following:

    This is the custom property page as of today (August 9, 2005). I plan to release the source code to this add in and also a compiled binary. I would really like to have a setup.exe application that can install it and configure active directory to use the new property page. Currently this is done manually by editing the Active Directory using a tool (adsvw.exe) that is included with the Active Directory SDK.

    Please let me know if you think this is a worth while project and if you think it could use any extra features. I am not sure when I will release the code because I really want to make sure there are no bugs. It is currently working fine, but I need to test it on a Windows 2000 Active Directory Server that does not have the Schema Additions added to it.

    So things to do:

    • Make sure there are no bugs in the code & comment the code.
    • Test on Windows 2000, Windows 2000 SBS, Windows 2003, Windows 2003 SBS (done)
    • Write a setup application to install DLL onto server.
    • Write a setup that can configure Active Directory to use the new property sheet.
    • Do all of this ASAP and release to the public.

    Please leave comments.


    Running multiple websites on Windows XP Professional

    On Windows XP Professional you can only have one web site, the UI will not let you create more than one, but you can actually create more by working with the IIS Metabase.

    You can only have one of these web sites active at a time and there are other limitations when using Windows XP such as:

    Windows XP Professional Windows 2000 and 2003 Server
    10 Simultaneous Connections Unlimited number of connections
    1 Virtual Web Site Unlimited number of Virtual Web Sites
    Does not support Host Headers (See below for a solution) Full support for Host Headers (WWW Service)
    Does not support ODBC logging Full support for ODBC logging
    Does not support IP and DNS Restrictions Full support for IP and DNS Restrictions

     

    IIS Admin is a small free tool that will allow you to have multiple web sites under Windows XP Professional and simply select which site is the active site. The same limitation of one web site being active is still enforced by IIS but you do get a nice simple way of selecting which site is active.

    The utility runs from the System Tray and you add new sites from the simple UI as well.

    For more details see - http://www.firstserved.net/services/iisadmin.php

    For those time when you really need multiple sites on a non Server product checkout MultiSite Filter Version 2

    On Windows 2000 and XP Professional this ISAPI filter will allow you to run multiple sites by  interrogating the host header of the incoming http request and on the outcome of that redirects the request to the relevant place in the filesystem.

    For more details see - http://www.hairy-spider.com/multisite.aspx


    IIS - URL Scan Security Tool 2.5

    UrlScan is a security tool that screens all incoming requests to the server by filtering the requests based on rules that are set by the administrator.

    Filtering requests helps secure the server by ensuring that only valid requests are processed.

    UrlScan helps protect Web servers because most malicious attacks share a common characteristic they involve the use of a request that is unusual in some way.

    For instance, the request might be extremely long, request an unusual action, be encoded using an alternate character set, or include character sequences that are rarely seen in legitimate requests.

    By filtering unusual requests, UrlScan helps prevent such requests from reaching the server and potentially causing damage.

    Note : Only version 2.5 and later are compatible with IIS 6

    For more details see - http://www.microsoft.com/technet/security/tools/urlscan.mspx

    To analyze the log files that are produced by UrlScan you can use Log Parse; for more details see - http://blog.crowe.co.nz/archive/2005/08/08/169.aspx


    IIS SSL Diagnostics Version 1.0
    A common problem for administrators of IIS servers is configuring and troubleshooting SSL enabled websites. To assist in administrators efforts, Microsoft has designed a tool - SSL Diagnostics - to aid in quickly identifying configuration problems in the IIS metabase, certificates, or certificate stores.

    This tool allows users to review configuration information in a easy to read view mode or to run the tool silently with only the creation of a log file. During use, administrators can simulate the SSL handshake to find errors. They can also quickly "hot swap" certificates for testing purposes.

    These packages come in two forms: Express and Full. The express will only give the pertinent tools for administrators to use SSL Diagnostics while full install installs the same files with the appropriate documentation. Included in the full install is a SSL Frequently Asked Questions that can assist in the learning of SSL for administrators.
     

    IIS Authentication and Access Control Diagnostics 1.0
    Authentication and Access Control Diagnostics 1.0 (more commonly known as AuthDiag) is a tool released by Microsoft aimed at aiding IT professionals and developers at more effectively finding the source of authentication and authorization failures.

    These users have often seen behavior from Internet Information Services (IIS) that doesn't seem appropriate or random when users authenticate to the IIS server. The complex world of authentication types and the various levels of security permissions necessary to allow a user to access the server causes many hours of labor for those tasked with troubleshooting these problems.

    AuthDiag 1.0 offers a robust tool that offers a efficient method for troubleshooting authentication on IIS 5.x and 6.0. It will analyze metabase configuration and system-wide policies and warn users of possible points of failure and guide them to resolving the problem. AuthDiag 1.0 also includes a robust monitoring tool called AuthMon designed at capturing a snapshot of the problem while it occurs in real-time. AuthMon is robust and specially designed for IIS servers removing any information not pertinent to the authentication or authorization process.
     

    IIS Crash/Hang Agent & IIS Dump
    The Internet Information Services (IIS) debug tools are designed to help determine which requests have caused IIS to crash and to log specific information when a request does not respond in an expected time period. This toolkit is made up of 2 main tools:
    • IIS Crash/Hang Agent: tracks all requests as they enter IIS and leave IIS and will log requests that are still being processed if IIS terminates unexpectedly. This tool also allows an administrator to configure a command line to run whenever a request takes too long to respond indicating a potential hang.
    • IIS Dump: The default command line for gathering information on Hangs; this tool is able to dump many different items at once for root cause analysis investigation. IIS Dump can produce text reports on stacks for each thread in an IIS-related process, dump files for each IIS-related process, dump the Metabase in an XML format file, and provide system DLL version information.

    For more information see - http://www.microsoft.com/downloads/details.aspx?FamilyID=01C4F89D-CC68-42BA-98D2-0C580437EFCF&displaylang=en


    Freeware - IIS / Tools / Log Files / The Webalizer

    The Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser.

    Features:

    • Is written in C to be extremely fast and highly portable. On a 200Mhz pentium machine, over 10,000 records can be processed in one second, with a 40 Megabyte file taking roughly 15 seconds (over 150,000 records).

    • Supports standard Common Logfile Format server logs. In addition, several variations of the Combined Logfile Format are supported, allowing statistics to be generated for referring sites and browser types as well. Now also has native support for wu-ftpd xferlog FTP and squid log formats as well.

    • Generated reports can be configured from the command line, or by use of one or more configuration files. Detailed information on configuration options can be found in the README file, supplied with all distributions.

    • Supports multiple languages. Currently, Catalan, Chinese (traditional and simplified), Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, Galician, German, Greek, Hungarian, Icelandic, Indonesian, Italian, Japanese, Korean, Latvian, Lithuanian, Malay, Norwegian, Polish, Portuguese (Portugal and Brazil), Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, Turkish and Ukrainian are available.

    • Unlimited log file sizes and partial logs are supported, allowing logs to be rotated as often as needed, and eliminating the need to keep huge monthly files on the system.

    • Distributed under the GNU General Public License, complete source code is available, as well as binary distributions for some of the more popular platforms. Please read the Copyright notices for additional information.

    For more details see - http://www.mrunix.net/webalizer/

    To see a sample report see - http://www.mrunix.net/webalizer/sample/index.html


    Freeware - IIS / Tools / Log Files / AWStats

    AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically.

    This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers.

    AWStats is a free software distributed under the GNU General Public License. You can have a look at this license chart to know what you can/can't do.

    For more details see - http://awstats.sourceforge.net/

    For a sample report see - http://awstats.sourceforge.net/cgi-bin/awstats.pl


    Freeware - IIS / Tools / Log Files / Analog
    Analog shows you the usage patterns on your web server by analyzing your Log Files. It is a very simple package to get going and has a good following, you can simply customize which reports are generated and there are a number of people who provide additional files such as Search Engines, and Spiders so the product can keep up to date with web bots etc.
    • Ultra-fast
    • Scalable
    • Highly configurable
    • Reports in 32 languages
    • Works on any operating system
    • Free software ( Licence is now GPL)

    For more details see - http://www.analog.cx/

    For a sample report see - http://www.chiark.greenend.org.uk/~sret1/stats/

    To generate even nicer reports you can combine Analog with another product called Report Magic - http://www.reportmagic.org/ for a sample report see - http://www.reportmagic.org/sample/index.html


    Freeware - IIS / Tools / Log Files / Microsoft Log Parser 2.2

    Microsoft Log Parser is a very cool little tool that you can use with a SQL query language to render details from a number of different log file formats including:

    • IIS log files in the NCSA Common, Combined, and Extended Log File Formats
    • IIS log files in the Microsoft Log File Format.
    • IIS log files in the W3C Extended Log File Format
    • IIS log files in the Centralized Binary Log File Format
    • IIS when configured to log in the ODBC Log Format

    • Active Directory Objects
    • Comma, Tab and Space Delimited Text Files
    • Enterprise Tracing for Windows trace log files (.etl files) and live ETW trace sessions
    • Windows Event Log and from Event Log backup files (.evt files).
    • Files and Directories
    • HTTP Error log files created by the Http.sys driver (IIS 6+ )
    • NETMON input format parses network capture files (.cap files) captured by the Network Monitor program (or exported from Ethereal)
    • Registry Values
    • Generic text files.
    • URLScan IIS filter log files
    • W3C Extended Log File Format
    • XML Files

    • Your Own Custom Plugins

    You tell Log Parser what information you need and how you want it processed.

    The results of your query can be custom-formatted in text based output, or they can be persisted to more specialty targets like SQL, SYSLOG, or a chart.  

    An example query:

    SELECT TOP 10 cs-uri-stem, COUNT(*)
    FROM ex040305.log
    GROUP BY cs-uri-stem
    ORDER BY COUNT(*) DESC

    For more details on Log Parser see http://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx

    The Unoffical Log Parser web site created and maintained by Mike Gunderloy see http://www.logparser.com/

    For some additional scripts and code examples for using Log Parser from c# see http://www.logparser.com/Repository.htm

    A book has been released called the Log Parser Toolkit - see http://www.syngress.com/catalog/?pid=3110

    For a details explanation of how Log Parse works see http://www.microsoft.com/technet/community/columns/profwin/pw0505.mspx

    For examples of using the COM interface to Log Parser see http://www.microsoft.com/technet/community/columns/scripts/sg0105.mspx


    Microsoft Internet Information Server Redirection

    What does this do and why would I want to know about it?

    Redirection is a facility that will allow a user to request one URL and end up being redirected to another URL.

    Why would you want this?

    • The site is down for maintenance and you would like to redirect all users to a specific page that lets them know this.
    • You have requests for a particular URL that is no longer valid and would like to redirect the users to the new URL.

    click here for the rest of the article..


    Microsoft SQL Server Report Pack for Internet Information Services (IIS)
    The Microsoft SQL Server Report Pack for Internet Information Services (IIS) is a set of 12 Microsoft SQL Server 2000 Reporting Services reports that works with a sample database of information extracted from Microsoft Internet Information Services (IIS) log files. This database can be populated with your own data using the Log Parser included with the IIS 6.0 Resource Kit. You can use also the sample reports as templates for designing new reports.

    This Report Pack includes the following reports:
    • Global Statistics
      Contains a top-level summary chart of visits and bandwidth for one or more sites with drillthough for each month.
    • Site Summary
      Contains a site summary for a specified site, month, and year. Includes a document map and all other detail reports.
    • Time Period
      Shows a parent report with subreports containing time and date based visitor statistics.
    • Day of Week
      Contains bar chart, bubble chart and table with visitor information per day.
    • Hourly Statistics
      Contains a chart and table with visitor information per hour of the day.
    • Day of Month
      Contains chart and table with visitor information per day of the month.
    • OS Statistics
      Shows a table containing of the number of visits based on the operating system type. Also shows detailed chart with version information for Windows OS visitors.
    • Browser Statistics
      Shows a table containing the number of visits based on the browser type. Also shows detailed chart with version information for Internet Explorer visitors.
    • Country Statistics
      Contains a breakdown (table and chart) of the number of visits based on the country of origin.
    • Length Statistics
      Contains a breakdown (table and chart) of the number of visits based on the amount of time spent on the site.
    • Pages
      Contains statistics about the top 5 most viewed pages on the site.
    • Visitors
      Contains of sub reports of Web site visitor statistics grouped by time and date.

    Download is approx 5MB

    http://www.microsoft.com/downloads/details.aspx?familyid=2805d337-14c7-40e3-820b-e7ee653c68c0&displaylang=en


    IIS-Resources.com IIS Admin Control Panel 1.0
    The IIS Admin Control Panel is a web based IIS Administration Tool that allows you to install, modify, delete WWW & FTP sites.  Some of the other features include: modification of SMTP Setting, User & Group Management, Management of User Quotas, IIS statistical information,  IIS 6 Application & Web Service Extensions Management.

    http://www.iis-resources.com/modules/AMS/article.php?storyid=421

    Important Differences Between Version of IIS (4, 5, 5.1 and 6)
      IIS 4.0 IIS 5.0 IIS 5.1 IIS 6.0
    Platform NT4 Windows 2000 Windows XP Professional Windows Server 2003 family
    Architecture 32-bit 32-bit 32-bit and 64-bit 32-bit and 64-bit
    Application process model TCP/IP kernel

    MTX.exe

    TCP/IP kernel

    DLLhost.exe (multiple DLL hosts in medium or high application isolation)

    TCP/IP kernel

    DLLhost.exe (multiple DLL hosts in medium or high application isolation)

    HTTP.sys kernel

    When IIS is running in IIS 5.0 isolation mode: Inetinfo.exe (in-proc processes) or DLLhost.exe (out-of-proc processes)

    When IIS is running in worker process isolation mode: W3Wp.exe (multiple worker processes)

    For more information on IIS isolation modes, see "Configuring Isolation Modes" in IIS Help, which is accessible from IIS Manager.

    Metabase configuration Binary Binary Binary XML
    Security Windows authentication

    SSL

    Windows authentication

    SSL

    Kerberos

    Windows authentication

    SSL

    Kerberos

    Security wizard

    Windows authentication

    SSL

    Kerberos

    Security wizard

    Passport support

    Remote administration HTMLA HTMLA No HTMLA

    Terminal Services

    Remote Administration Tool (HTML)

    Web Server Appliance Kit (SAK).

    Terminal Services

    Cluster support In Windows NT 4.0 IIS clustering Windows support Windows support
    WWW services IIS on NT 4.0 Personal Web Manager on Windows 9x

    IIS on Windows 2000

    IIS optionally on Windows XP Professional IIS on a member of the Windows Server 2003 family

    How to create a Maintenance Site in IIS and a script to toggle between the Live and Maintenance Site
    I found the following question on the IIS newsgroup and felt that I could offer one solution to the problem.

    Question:

    I am hosting a site for a small business, and I need to stop the site from being accessible for a little while.

    Is there a way that when I stop the site in IIS, that instead of the message saying that the 'site is under construction' that I can put up
    my own error message?

    What error # is it?  And how can I get it to show that # when I stop the site automatically?

    Answer:

    Well my answer starts off with the fact that IIS can not send a message back to the client when the site is stopped otherwise it would not be stopped.

    If the site is stopped and no other sites are handing the same IP Address and Port then IE will display a message such as:

    Cannot find server or DNS Error

    The fact that the user is getting "site is under construction" message leads me to believe that the Default Web Site is still running on the server and the user has their customers site running on another site on the server.

    If the admin is wanting to take the site down for maintenance how does the admin configure this?

    My solution is to have two web sites for the customer.

    Web Site #1 - This is their Live Site

    Web Site #2 - This is the Maintenance Site

    Web Site #1 is configured how they need - we do not want to adjust this site settings hence the need for the 2nd site.

    To create Web Site #2 use the following settings:

    We assume the following:

    Web Site #1 - the Home Directory points to d:\WebSites\Customers\Customer1\www

    1) Create a folder on your server to host the 2nd site - this could be a child folder of the first site if required or a new folder anywhere.

    We will create the following folder.

    d:\WebSites\Customers\Customer1\www\Maintenance

    2) Create a default.htm file with your maintenance message and place it in the above folder.

    3) Create a New Web Site and set its Home Directory to

    d:\WebSites\Customers\Customer1\www\Maintenance

    Set it to the same IP Address, Port and Host Header

    4) On the Custom Errors tab for the web site change the 404 error to use URL and set the URL to /default.htm

    This will then handle any requests for pages within your site that do not exist.

    5) On the HTTP Headers tab enable Content Expiration and set it to Expire Immediately

    6) Make sure that the Maintenance Site is not running and the Live Site is running - (this is the default since the live site is already using the IP, Port and Host Header)

    7) Determine the Web Site ID for both the Live and Maintenance Sites

    A quick method to locate these IDs is to look at the Log File Path.

    On the Web Site tab click on Properties to open the Log File Properties dialog

    At the bottom of this dialog is the Log file name which will be something like the following:

    W3SVC38347383\exyymmdd.log

    We are only interested in the Number so from the above filename we take the number and this is the site ID.

    38347383

    Another method is to use the FindWeb.VBS which is normally installed in c:\inetpub\adminscripts folder if you have included the admin scripts in the installation.

    Do this for both web sites the Live and the Maintenance sites.

    We then create a small VB Script which we run to toggle the Sites.

    Make sure you edit the LiveSiteInstanceID and the MaintenanceSiteInstanceID values in the code.

    Option Explicit
    dim LiveSiteInstanceID, LiveObj, LiveStatus
    Dim MaintenanceSiteInstanceID, MaintenanceObj, MaintenanceStatus
    dim WhichSite
    LiveSiteInstanceID = 68783193
    MaintenanceSiteInstanceID = 2021379493
    ' Status
    ' 1 = Starting
    ' 2 = Started
    ' 3 = Stopping
    ' 4 = Stopped
    ' 5 = Paused
    ' 6 = Pausing
    ' 7 = Continuing
    ' otherwise unknown
    
    set LiveObj = GetObject("IIS://localhost/w3svc/" & LiveSiteInstanceID)
    LiveStatus = LiveObj.Status
    set MaintenanceObj = GetObject("IIS://localhost/w3svc/" & MaintenanceSiteInstanceID)
    MaintenanceStatus = MaintenanceObj.Status
    if (LiveStatus = 2) then ' This site currently live
    ' Stop the live site and start the Maintenance site
    wscript.echo "Stopping the Live Site - " & LiveObj.ServerComment
    wscript.echo "Starting the Maintenance Site - " & MaintenanceObj.ServerComment
    LiveObj.Stop
    MaintenanceObj.Start
    WhichSite = "Maintenance"
    else
    ' Stop the Maintenance site and start the Live site
    wscript.echo "Stopping the Maintenance Site - " & MaintenanceObj.ServerComment
    wscript.echo "Starting the Live Site - " & LiveObj.ServerComment
    MaintenanceObj.Stop
    LiveObj.Start
    WhichSite = "Live"
    end if
    WScript.echo
    wscript.echo "Task completed - the " & WhichSite & " site is now running ...."
    set LiveObj = nothing
    set MaintenanceObj = nothing

    You then run the code in the DOS prompt using the CSCRIPT console scripting tool.
     
    cscript ToggleBlog.vbs

     
     
    If you want to download the script file please click here ( It is in .TXT format )