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)

Archive

April 2006 (12)

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

 


Visual Studio Express now a free product permanently
Effective April 19th, 2006, all Visual Studio 2005 Express Editions including Visual Basic, Visual C#, Visual J#, Visual C++, and Visual Web Developer Express will be free permanently! 

Prior to this pricing announcement, Visual Studio Express Editions were promotionally discounted to be free for one year, starting on November 7th, 2005. With this announcement, the promotional discount for Visual Studio Express is now permanent and Express will continue to be free.

Also there is a number of starter kits released...

Microsoft .NET Interface for Lego Mindstorms Starter Kit
The Microsoft .NET interface for Lego Mindstorms enables you to programmatically control Lego Mindstorms directly from Visual Basic, Visual C#, Visual J#, or Visual C++ Express. We also have a dedicated sub-page on Coding4Fun on programming Lego Mindstorms with Express.

Beta: Skype Wrapper for .NET Starter Kit
The Beta of the Skype Wrapper for .NET Starter Kit is a managed code wrapper with samples that enables to programmatically connect and consume Skype services from Visual Basic, Visual C#, Visual J#, or Visual C++ Express.

MediaShare Messenger Starter Kit
The Media Share Messenger Starter Kit is a fully functioning Visual C++ Express custom chat client that enables you to send instant messages to your friends and even share your music collection with them over a local area network (LAN).

Annotated Travel Log Starter Kit
The Annotated Travel Log Starter Kit is a fully functioning Visual C++ Express travel planning and tracking application you can use to manage your travel plans & routes, as well as track and record your progress.

Beta: Classifieds Site Starter Kit
The Classifieds Site Starter Kit Beta provides a complete, ready to run, fully customizable, Web site for listing and managing classified advertisements with Visual Web Developer Express and SQL Server Express.

Teacher Starter Kit
The Teacher Starter Kit is a rich client application for keeping track of students, course rosters, and assessments or grades using Visual Basic or Visual C# Express.

Maker Faire Demo: Dancing4Fun
The Dancing4Fun demo is a homemade version of the popular Dance, Dance, Revolution arcade game using Phidgets touchpad sensors to time your dancing just right.

Maker Faire Demo: MSN Spaces Photo Booth
The MSN Spaces Photo Booth demo shows how you can integrate a pan-and-tilt web cam, and an Xbox 360 controller to dynamically upload pictures to your MSN Spaces Web site.

Maker Faire Demo: Skype Home Automation
The Skype Home Automation extends the Skype Starter Kit to show how you can use an instant messaging application to communicate with a home server for the purposes of automation and monitoring, like checking if the lights are on, or even play your favorite music.

How-To Videos: Windows Forms Controls
These bite-sized 5-15 minute videos that show how to use common Windows Forms controls including the SoundPlayer, FlowLayout, NotifyIcon, Button, and other controls using Visual Basic or Visual C# Express.

Video Series: SQL Server 2005 Express for Beginners
This four-hour video series is designed for beginners who are interested in learning the basics of how to create and manage data using SQL Server 2005 Express.

Video Series: Learn how to create Rocket Commander
Watch and learn how to create professional looking 3D games like RocketCommander using Managed DirectX and Visual C# Express in this 10-part instructional video series. 

Webcast Series: Tools for the Hobbyist Developer
The Tools for the Hobbyist Developer webcast series covers the spectrum of Express content including game development, programming for hardware, database development and more.

More details : http://forums.asp.net/thread/1262185.aspx


VS2005 Plugin - CSS Properties Window

Visual Studio 2005 provides some capabilities for visually editing the styles for elements in an HTML or ASP.NET page. For example, in Design view, you can right-click a control or element, and then choose Style to display the Style Builder dialog box. Although the style builder enables you to create and edit in-line styles, there's no way to edit the styles that are inherited from a linked style sheet.  The new CSS Properties window provides this capability — it enables you to edit both in-line styles and styles in linked style sheets.

The CSS Properties window is an add-in package to Visual Studio 2005. It does not change the behavior of any feature in Visual Studio 2005; it simply adds additional functionality specific to editing CSS in Design view.

Features

Using the CSS Properties window, you can do the following:

  • Display in-line styles and styles inherited from <style> blocks and linked style sheets.
  • Edit in-line styles and styles in linked style sheets. (The CSS Properties window displays styles from <style> blocks, but does not enable you to edit them.)
  • Display drop-down lists of styles and values to help you create valid style definitions.
  • Drag style settings between different elements and to and from a style sheet.
  • Edit styles for multiple elements.

For more details see http://www.asp.net/sandbox/app_sandman.aspx?tabindex=0&tabid=1


VS 2005 plugin that provides support for spell-checking HTML and ASP.NET pages
One of the Visual Studio Web Tools Team just published a cool free plug-in for VS 2005 that provides support for spell-checking HTML and ASP.NET page content within the VS 2005 IDE:

You can download the plugin from http://blogs.msdn.com/mikhailarkhipov/archive/2006/04/17/577471.aspx

Note: The page above has a large white space so you will need to scroll to the bottom to see more details...

 


SQL Server 2005 Service Pack 1 has been released
Service Pack 1 for Microsoft SQL Server 2005 is now available. The download which will range 250MB to a wopping 900MB can be used to upgrade any of the following SQL Server 2005 editions:
  • Enterprise
  • Enterprise Evaluation
  • Developer
  • Standard
  • Workgroup

Download Link

http://www.microsoft.com/downloads/details.aspx?familyid=cb6c71ea-d649-47ff-9176-e7cac58fd4bc&amp;displaylang=en

A list of the new features and improvements that are included in SQL Server 2005 Service Pack 1 can be view here.

http://support.microsoft.com/kb/916940


BrowserShots.org - View images of your website from multiple browsers and operating systems.

Basically the browsershots.org site will allow you to submit your web site and have its clients render your site using a number of different browsers and you can then see how your site looks on different operation systems and browsers and browser versions.

The day I visited the following browsers were supported.

  • Epiphany 1.4.8
  • Firefox 1.0.4
  • Firefox 1.5.0
  • Galeon 1.3.20
  • Konqueror 3.3
  • Mozilla 1.7.8
  • MSIE 6.0
  • MSIE 7.0 Beta
  • Opera 8.50
  • Safari 2.0

There is a limit in the size of the queue to around 60 minutes which means that only the browsers that are available within the 60 minutes will take your job when you submit it.

This service is free for you to use because of the way the site works.

Basically they have a server sitting around with a big pipe to the Internet and clients ( nice people who will do the automated screen captures) will accept a job and the client will then use their browser to browse to the site in question and produce a PNG graphic. The client will then submit the image to the central server which stores it so you can view it later.

You can see my site in the following browsers below:

 

Firefox 1.5.0

Screenshot of Firefox 1.5.0
 

Konqueror 3.3

Screenshot of Konqueror 3.3

Mozilla 1.7.8

Screenshot of Mozilla 1.7.8


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>

Is your Visual Studio 2005 editor extremly slow when you type?

I have been getting very frustrated with the Visual Studio 2005 code editor being very very slow. I found a reference to a potential fix to this issue.

Symptoms

Typing into the VS.NET 2005 code editor can be extremely slow.

Test

Open a project (C#) in VS.NET 2005 and go to the code editor.

Place your cursor between functions and just hold down the "1" key for about 5 seconds.

How many key presses got recorded? in my case about 45 and they only appeared after another 5 seconds, now follow the steps below and then repeat.

Potential Fix

The Navigation Bar appears to be causing this excessive slow down. Do you even know what the Navigation bar is? THe Navigation bar is displayed at the top of the code window and updates so you can jump to a function or definition of an object directly instead of searching or scrolling.

I have seen these Navigation bars since VB days but I never use them so I have no problem with turning them off.

In VS.NET 2005 select Tools - Options to open the Options dialog.

Scroll down to the Text Editor node and then select C# and then the general tab.

Now remove the check next to the navigation bar.

Click OK

Is it faster?

On my computer I now get about 135 characters in 5 seconds.

Reference : http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=154948&SiteID=1


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"