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

August 2005 (83)

Mapping drive letters to SharePoint document libraries

Microsoft Sharepoint technology is allows us to interface with its content via WebDav.

The Sharepoint File System is a proprietary web folder (WebDAV) implementation that is served through IIS 6.0.

WebDAV RFC 2518 (http://www.ietf.org/rfc/rfc2518.txt) defines WebDAV as a set of methods, headers, and content-types ancillary to HTTP/1.1 for the management of resource properties, creation and management of resource collections, namespace manipulation, and resource locking (collision avoidance). Read more on WebDAV at http://www.webdav.org.

The general way that you normally interface with a WebDav enabled server is via My Network Places 

  • Open Windows Exploer

  • Select "My Network Places" on the left pane under "Other Places"

  • Click on "Add a Network Place"

  • The "Add Network Place" wizard will then start, click on Next

  • Select "Choose another network location" and click next

  • Type in your path to your document library such as "http://www.mywebserver.com/Shared Documents" and click next

  • Give it a name and click next

  • Click finish

Your Network Place will then be displayed in an explorer window. This window however does use the full path that you specified as the location/address in Explorer ( \\www.mywebsite.com\Shared Documents ). Wouldn't it be nicer to map it to a drive letter such as X: so that any application can save directly into the Sharepoint document library?

Well you can if you follow these steps instead.

From Windows Explorer

  • Open Windows Explorer

  • Select Tools / Map Network Drive

  • Select your drive letter

  • Under Folder : enter your url to your document library such as "http://www.mywebserver.com/Shared Documents"

  • If you want to connect as a specific user click "Connect using a different name" and enter the other user credentials.

  • Click on Finish

From a CMD.EXE Prompt

  • Start a command prompt  (type cmd.exe into the Start-Run option)
  • Type in the following:

    net use x: "http://www.mywebserver.com/Shared Documents" /user:DOMAIN\LOGIN PASSWORD
     
  • You will now have a drive letter mapped to the Shared Documents folder.

Note: You will need to enable the WebClient service if it is not running already on Windows XP


c# - Open Source Projects written in c#

Here is a site that lists open source c# projects such as:

  • Aspect-Oriented
  • Bloggers
  • Build Systems
  • Charting & Reporting
  • Chat Servers
  • CMS
  • Code Coverage
  • Forum Soft
  • IDEs
  • Installers
  • Inversion of Control
  • Issue Tracking
  • Logging Tools
  • Network Clients
  • Network Servers
  • PDF Libraries
  •  
  • Persistence
  • Portals
  • Profilers
  • Project Management
  • RSS & RDF Tools
  • Rule Engines
  • Search Engines
  • Source Control
  • SQL Clients
  • Template Engines
  • Testing Tools
  • Web Frameworks
  • Web Mail
  • Web Testing
  • Wiki Engines
  • XML Parsers
  • For more details see http://csharp-source.net/

    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


    ASP.NET - How to render a Server Control to a string

    The following method renders control into HTML string.


       public static string RenderControl(Control ctrl) 
       {
          System.Text.StringBuilder sb = new System.Text.StringBuilder();
          System.IO.StringWriter tw = new System.IO.StringWriter(sb);
          System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
          ctrl.RenderControl(hw);
          return sb.ToString()
       }
    

    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)


    ILMERGE - Merge multiple .NET assemblies (.exe, .dll) into a single .NET assembly

    ILMerge is a utility that can be used to merge multiple .NET assemblies into a single assembly. ILMerge takes a set of input assemblies and merges them into one target assembly. The first assembly in the list of input assemblies is the primary assembly. When the primary assembly is an executable, then the target assembly is created as an executable with the same entry point as the primary assembly. Also, if the primary assembly has a strong name, and a .snk file is provided, then the target assembly is re-signed with the specified key so that it also has a strong name.

    ILMerge is packaged as a console application. But all of its functionality is also available programmatically. While Visual Studio does not allow one to add an executable as a reference, the C# compiler does, so you can write a C# client that uses ILMerge as a library

    For more details see - http://www.microsoft.com/downloads/details.aspx?FamilyID=22914587-B4AD-4EAE-87CF-B14AE6A939B0&displaylang=en


    Windows F-Lock Key

    I came across this interesting article on the F-Lock keys on recent Microsoft Keyboards.

    The F Lock key is a hardware switch in the keyboard. Its state cannot be controlled programmatically. Its default condition is "off". As a result, whenever the keyboard is reset, or loses power, the F Lock key will always be in an "off" state.  Do note that with the MSFT keyboards released after September 2004, the keyboard will retain F Lock status through a reboot.

    For some, this is not a desirable default; some people want "normal" function key operation.

    While there is no way to control the F Lock key state programmatically, Windows 2000, Windows XP and Windows Server 2003 provide a method whereby keys can be remapped by using the Scan Code Mapper. The Scan Code Mapper can be used to change the functions of the function keys. Unfortunately, this functionality is not available for earlier Windows versions.

    For more details and a way to switch the keys around see - http://www.mvps.org/jtsang/flock.html


    Looking for the source to the .Net Framework Libraries

    We all know that Microsoft has not released the source code to the .NET Framework.

    If you do not know about a tool called .Net Reflector, then you are missing something very important. With this tool you can view the code to .NET DLL's that have not been obfuscated

    I was looking to try and find a problem with a Server Control I was writing for ASP.Net - this server control was inherited from TextBox and I had a problem with trying to add a collection property to the control. I could get it rendered correctly to the WebForm but when I reopened the web form the .TEXT property was filled with my collection details and the collection property was empty.

    Using this tool you can see code for objects such as TextBox and therefore maybe make a better choice in the way you develop code.

    See example below for the AddAttributesToRenderMethod of the TextBox class for ASP.Net

    For more details where you can download this tool see - http://www.aisto.com/roeder/dotnet/

    Also see Lutz Roeder's Weblog for more details regarding .Net Reflector

    For addons such as rendering the source in different languages see http://csharp21.tripod.com/ReflectorAddIns

    I wish I had used this tool before - thanks Lutz for writing it and releasing it to the community.


    SmartPart for SharePoint - Install Fails and the log file is empty

    This article is about SmartPart for Sharepoint, a SharePoint Webpart that can host any ASP.NET user control.

    Create your webparts by using the VS.NET designer instead of coding everything by hand!

    see http://www.gotdotnet.com/workspaces/workspace.aspx?id=6cfaabc8-db4d-41c3-8a88-3f974a7d0abe

    When you install the execelent SmartPart addon for Sharepoint you may for some reason get an error during the install and you can not install the MSI package that is included in the version 1.0.0.0 release.

    This error tells you to look at a log file but the log file is empty - so no help there.

    On the WorkSpace message board a very knowledgable person who goes by the name of fahadaz left intructions for how to create your own cab file to install the SmartPart.dll

    Well I struck problems since I was missing the Manifest.XML file and the SmartPart.dwp file which fahadaz said to package into the cab file along with the SmartPart.dll

    So fahadaz has since replied to my question and provided the Manifest.XML and the SmartPart.dwp files.

    I have since packaged the files up into a CAB file that you can download from here. 

    To install the CAB file again using instructions provided by fahadaz

    • Open a “CMD.EXE” command prompt
    • Navigate to the following path using “cd“

      c:\Program Files\Common Files\Microsoft Shared\web server extensions\60\bin
    • enter this command to install the package into Sharepoint for all Sharepoint sites.

      stsadm -o addwppack -globalinstall -force -filename "c:\\.cab"

    The results of running the above command can be seen below.

    So you now have it installed into the Global Assembly Cache and it is now useable from within Sharepoint.

    You will now want to use the documentation provided in the readme.rtf file that was provided in the original zip file archive and go to work making some cool user controls to work with Sharepoint.


    Another problem I had

    I had to set my trust level in my web.config for the site to WSS_Medium to get the DropDown Sub Site List sample which is included in the package, this was on Small Business Server 2003.

    I had to edit the web.config file in the home directory for the web site.

    Near the bottom of the web.config file you will find a line like this:

       <TRUST originUrl="" level="WSS_Minimal" />

    You need to change it to the following

       <TRUST originUrl="" level="WSS_Medium" />


    Microsoft Office SharePoint Portal Server 2003 Virtual Lab for Free

    Get first-hand deployment experience through the Virtual Lab series. The Microsoft Office SharePoint Portal Server 2003 hands-on labs will teach you how to set up the portal, organize content on the portal, manage user permissions, create Web Parts for custom tasks, and much more.

    Step into the Microsoft Office SharePoint Portal Server 2003 Virtual Lab for Free

    It's simple — no complex setup or installation is required to try SharePoint Portal Server running in the full-featured TechNet Virtual Lab. You get a downloadable manual and a 90-minute block of time for each module. You can sign up for additional 90-minute blocks anytime.

    As part of the TechNet Virtual Lab, you will have full access to SharePoint Portal Server's features and tools through ten modules:


    Note: Requires Remote Desktop ActiveX control to be installed and I assume port 3389 opened on your firewall.


    HTML - How to popup a DIV tag over a SELECT tag

    The following code will allow you to popup a DIV tag so that even if the DIV tag is displayed over a SELECT tag the DIV will not show any of the select tag. The way it does this is by placing an IFRAME over the top of the DIV tag.

    Examples in both IE and Mozzila below.

    IE 6
    Mozilla Firefox 1.04

    The code also uses a free 3rd party Javascript library called Anchor Position by Matt Kruse - http://www.mattkruse.com/ 

    This library allows you to get the location of an element on the page. It will return the XY coordinates of the element. It is used to handle the placement of the DIV tag in the example below.

    I also use a blank.htm file for the src parameter of the IFRAME - you may be able to get rid of this by using a javascript function instead.

    The following code works in both IE 6 and also Mozilla Firefox 1.04 - I have not tested on other browsers at this time.

    For a live demo see http://blog.crowe.co.nz/attachments/DivTagDemo.htm

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>How to popup a DIV over a SELECT Tag</title>
    </head>
    <body bgcolor=#FFFFCC>
    <script language="javascript" src="AnchorPosition.js"></script> <!-- This is our DIV Tag that will popup over the current content, when we popup our div tag, we place
    an IFRAME over the top of the div tag. This is so we can hide the Select tag. We then place a table after the IFRAME and force it to be positioned starting at the top left
    of our div tag.
    --> When you click the link below the popup will show over the top of the div <div id="floatingdiv" style="position:absolute;display:none;left=30;top=20;width=300;height=150"> <iframe id="selectblocker" style="position:relative;" frameBorder="0" scrolling="no" src="blank.htm"></iframe> <table border=1 cellspacing=5 id="contents" style="position:absolute; background-color: #CCFF99"> <tr> <td valign='top'>This is the actual contents that we want to display within the DIV tag area.</td> </tr> </table> </div>
    <form method="POST" action="">
    <table border=1 cellspacing=2 cellpadding=2>
    <tr><td>Enter your name</td><td><input type="text" name="name" id="name" size=10 style="width:200px">
    </td></tr> <tr><td>Please select your occupation</td><td><select size="1" name="D1" id="D1" style="width:200px"> <option>Programmer</option> </select> </td></tr></table> </form> <!-- move our hide and show links away from the div tag --> <a href="Javascript:Show();">Show</a>   <a href="Javascript:Hide();">Hide</a>



    <
    script language="javascript"> function Show(){ var divTag = document.getElementById("floatingdiv"); var iFrameTag = document.getElementById("selectblocker"); var tableTag = document.getElementById("contents"); var AnchorPos = getAnchorPosition("name") divTag.style.left=AnchorPos.x+20; divTag.style.top=AnchorPos.y+22; divTag.style.width=300; divTag.style.height=150; iFrameTag.style.left = 0; iFrameTag.style.top = 0; iFrameTag.style.width = divTag.style.width; iFrameTag.style.height = divTag.style.height; iFrameTag.style.zIndex = divTag.style.zIndex-1; tableTag.style.left = 0; tableTag.style.top = 0; tableTag.style.width = divTag.style.width; tableTag.style.height = divTag.style.height; tableTag.style.zIndex = divTag.style.zIndex; divTag.style.display = "block"; } function Hide(){ var divTag = document.getElementById("floatingdiv"); divTag.style.display = "none"; } </script>
    </body>
    </html>
    

    Windows Sharepoint Services - Undelete Files

    I have been looking for some tools to help with Windows Sharepoint Services to undelete files that have been deleted. I have come across a number of potential solutions but all with problems.

    Recycle Bin for WSS - a MSDN Mag article

    This article discusses the WSS object model and is setup to handle events from within the WSS engine. The problem I see with this solution is that the files are not merely copied to the recycle bin when they are deleted they are actually mirrored so if you have a lot of files you are doubling the space required.

    This is a very good article on how to implement custom handlers for WSS events so it has value to me in that aspect.

    http://msdn.microsoft.com/msdnmag/issues/05/02/RecycleBinforWSS/default.aspx


     SharePoint Experts PowerRecycle™ (Commercial and not yet available)

    It does not capture the deleted file/item if you delete it using Excel, Explorer View, Network Places, or Datasheet View, which means that if you delete using the WebDav interface then you do not get the file placed into the recycle bin.

    As of August 17, 2005 this product is not available and has been like this for months that I know of.

    http://www.sharepointexperts.com/software_undelete.htm


    For more details on Backup and Restore Options for Windows SharePoint Services see the following article:
    http://www.microsoft.com/resources/documentation/wss/2/all/adminguide/en-us/stsf20.mspx

    See Also

    The Administrator's Guide for Windows SharePoint Services
    http://www.microsoft.com/resources/documentation/wss/2/all/adminguide/en-us/default.mspx

    Click here to download the Windows SharePoint Services Administartor's Guide.


    Windows Sharepoint Services - Sites and Blogs

    The following web sites are good resource for WSS and Sharepoint Portal Server 2003 (in no particular order)

    Sites

    Blogs

    Sharepoint Downloads from Microsoft


    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/


    Outlook Express - Quick way to view the source of a newsgroup message

    With Outlook Express a quick way to view the source of a newsgroup message is to press Ctrl-F3

    To use the mouse you will need to perform a number of steps:

    • Right click the message in the message list (not in the body of the message)
    • Select Properties
    • Select the Details Tab
    • Select Message Source

    Outlook Express - Command Line Options
    If you want to use outlook express as a newsreader only and do not want to use it for email the following command line parameters may be useful to you.

    outnews or newsonly

    This option starts Outlook Express in the News Reader Only mode. When you use this option, you cannot send or receive e-mail, and the Mail tab in the Internet Accounts dialog box is missing.

    Also if you want to only use Outlook Express for email then use the following parameter

    mailonly

    This option starts Outlook Express in the Mail Only mode. When you use this option, you cannot view newsgroups, and the News tab in the Internet Accounts dialog box is missing.

    Note that this command-line switch does not work in Outlook Express 5.


    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


    How to stop the Windows Search tool from looking inside of Zip Files

    By default on Windows XP when you do a search for files the Microsoft search tool will search inside of zip files which means that this tool takes for ever to run.

    If you have WinZIP or another archiver on your system then the following will allow you to stop this behaviour.

    • Open a CMD.EXE dos prompt
    • Navigate to c:\windows\system32 (or what ever path you have windows installed into)
    • Type in the following:

      regsvr32 /u zipfldr.dll

      You should then get a dialog saying DllUnregisterServer in zipfldr.dll succeeded.

    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


    Log Parser - Sample - How to return the number of files and their size in a folder and all child folders.

    The Log Parser 2.2 and greater is a very powerful little tool for things that you may not even think about such as enumerating the number of files in a folder and the size that they are consuming.

    With these examples we will be using the -i:FS input parameter which means we are getting our data from the File System.

    Example 1

    The command below will return the total number of files and the size of those files in the c:\temp folder and all child folders.

    LogParser.exe "SELECT count(Size) as [Total Files], sum(Size) as Size FROM 'c:\temp\*.*' " -i:FS
     
    Note: The command line above should be entered on a single line.

    The resulting output is similar to this:

    Total Files     Size
    -----------         ----------
    3154               3856346363
     

    Example 2

    To restrict the returned details where files start with the letter 'A' you can use this command:

    LogParser.exe "SELECT count(Size) as [Total Files], sum(Size) as Size FROM c:\temp\*.* where Name like 'A%' " -i:FS

    Note: The command line above should be entered on a single line.

    The resulting output is similar to this:

    Total Files       Size
    -----------           ----------
    98                    336363

    Example 3

    To restrict the returned details where files that have an extension of 'XML' you can use this command:

    LogParser.exe "SELECT count(Size) as [Total Files], sum(Size) as Size FROM c:\temp\*.* where EXTRACT_EXTENSION(Name) = 'xml' " -i:FS

    Note: The command line above should be entered on a single line.

    The resulting output is similar to this:

    Total Files      Size
    -----------          ----------
    16                   234374 
     

    The 3 examples above have all defaulted to recursively searching all child folders. You can control this with the recurse parameter.

    • -recurse:-1     Unlimited depth
    • -recurse:0       Disable recursion
    • -recurse:5       Recursively search to a maximum depth of 5 folders

    Example 4

    Return the total XML files and size, recursively searching folders to a depth of two.

    LogParser.exe "SELECT count(Size) as [Total Files], sum(Size) as Size FROM c:\temp\*.* where EXTRACT_EXTENSION(Name) = 'xml' " -i:FS -recurse:2

    Note: The command line above should be entered on a single line.

    The resulting output is similar to this:

    Total Files      Size
    -----------          ----------
    26                   433224 
     

    Example 5

    Return the filename, and calculates the MD5 hash of the content of the XML files in the current folder.

    LogParser.exe "SELECT Name, HASHMD5_FILE(Path) FROM c:\temp\*.* where EXTRACT_EXTENSION(Name) = 'xml' " -i:FS -recurse:0

    Note: The command line above should be entered on a single line.

    The resulting output is similar to this:

    Name        HASHMD5_FILE(Path)
    -------------- --------------------------------
    1.xml         7F404D2B02690712C4800D03928FE292
    2.xml         60F3600467DD164D9D748D3DCB212CE6
    3.xml         B72BABBC411445B5BAA144983046E57A
    4.xml         893D233CFCD8A07666960303C7F35657
     

    Example 6

    Create a chart of the number of files in c:\temp and break it down by file type, and displays it (it also writes a file called chart.gif). ( very powerful )

    LogParser.exe "SELECT EXTRACT_EXTENSION(Name), count(Size) into chart.gif FROM c:\temp\*.* group by EXTRACT_EXTENSION(name)" -i:FS -view -charttitle "Count of files by type in c:\temp"

    Note: The command line above should be entered on a single line.

    The resulting output is similar to this:


    How to set the return code (ExitCode) from a c# Console Application

    The following is the way to specify an exit code in a c# application. A value of 0 is normally a sign of success and a value of 1 or more a sign of failure.

    int MyErrorCode = 0

    System.Environment.ExitCode = MyErrorCode


    [Freeware] Nullsoft Scriptable Install System

    An installer is the first experience of a user with your application. Slow or unsuccessful software installations are the most irritating computer problems. A quick and user friendly installer is therefore an essential part of your software product.

    NSIS (Nullsoft Scriptable Install System) is a tool that allows programmers to create such installers for Windows. It is released under an open source license and is completely free for any use.

    NSIS can create Windows installers that are capable of installing, uninstalling, setting system settings, extracting files, etc. Because NSIS is based on script files, you can create both simple or advanced installers.

    Small overhead size

    NSIS is created to be small, fast and and efficient. While other installers often add hundreds of kilobytes or several megeabytes to your installer data, a full featured NSIS installer has an overhead of only 34 KB.

    Compatible with all major Windows versions

    You can create a single installer that is compatible with Windows 95, Windows 98, Windows ME, Windows NT, Windows 2000, Windows XP and Windows Server 2003.

    For more details see - http://nsis.sourceforge.net/features/


    Looking for a list of the TCP/IP ports that Windows Systems use?

    This article discusses the essential network ports, protocols and services that are used by Microsoft client and server operating systems, server-based programs and their subcomponents in the Microsoft Windows server system. Administrators and support professionals may use this Microsoft Knowledge Base article as a road-map to determine what ports and protocols Microsoft operating systems and programs require for network connectivity in a segmented network.

    http://support.microsoft.com/default.aspx?scid=kb;en-us;832017


    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.

    Regular Expressions - [ Freeware ] Expresso 2.1

    Expresso is useful for learning how to use regular expressions and for developing and debugging regular expressions prior to incorporating them into C# or Visual Basic code.

    • Build complex regular expressions by selecting components from a palette
    • Test expressions against real or sample input data
    • Display all matches in a tree structure, showing captured groups, and all captures within a group
    • Build replacement strings and test the match and replace functionality
    • Highlight matched text in the input data
    • Test automatically for syntax errors
    • Generate Visual Basic or C# code
    • Save and restore data in a project file
    • Maintain and expand a library of frequently used regular expressions

    For more details see - http://www.ultrapico.com/Expresso.htm

    For more details on Regular Expressions try:


    Step/Step - An example of updating a Windows Sharepoint Server List from c#

    1) Open Visual Studio.NET 2003

    2) New Project (We will create a console application in this demo)

    3) Name your project "GetListItems"

    4) Right Click on "References" under the Project and select "Add Web Reference"

    5) In the URL field type the path to your Windows SharePoint Services Site that contains the list you want to use.

    Each site is different and only contains the lists for the particular child site.

    For example the root site could be called "http://sharepoint.mysite.com" and you could have a sub site called "Test" which is accessible via "http://sharepoint.mysite.com/Test"

    So type in your URL and append the following "_vti_bin/lists.asmx"

    So if you were going to the "Test" child site your URL would be like this:

    http://sharepoint.mysite.com/Test/_vti_bin/lists.asmx

    You may be prompted to log onto your SharePoint site when do perform this action.

    6) Click on "Go" and the Add Web Reference Dialog should display that it found one service and display you some available operations.

    7) Click on "Add Reference"

    8) Now you should end up with a new Web Reference Node in the Solution Explorer and your actual Web Reference which may have a funny name like "com.mysite.sharepoint"

    9) Right click on the Web Reference and rename it to something simple like "SharePoint", this is what we will use to reference the web service in code.

    10) Right click on the Web Reference and select "Properties" and change the "URL Behavior" to "dynamic"

    This will add a "app.config" to the project and populate an appSettings item in the config file so that the URL is dynamically loaded from the "app.config" file and not hard coded into the source of the proxy stub that was created.

    <?xml version="1.0encoding="utf-8"?>
    <configuration>
         <appSettings>
               <add key="GetListItems.Sharepoint.Listsvalue="http://sharepoint.mysite.com/Test/_vti_bin/lists.asmx"/>
         </appSettings>
    </configuration>

    11) Open the Class1.cs file in the editor and enter the following:

    using System;
    using System.Net;
    using System.Xml;

    namespace GetListItems
    {
        /// 
        /// Summary description for Class1.
        /// 

        class Class1
        {
            /// 
            /// The main entry point for the application.
            /// 

            [STAThread]
            static void Main(string[] args)
            {
                string Username="UserName";
                string Password="Password";
                string Domain="Domain";
                string ListName = "ListName";

                Sharepoint.Lists ListsService = new Sharepoint.Lists();
                ListsService.Credentials = new NetworkCredential(Username, Password, Domain);

                // Create a new XML document to hold the updates we are going to perform
                XmlDocument doc = new XmlDocument();
                XmlElement updates = doc.CreateElement("Batch");
                updates.SetAttribute("OnError""Continue");

                // We need to Create a Method Tag for each row we are going to update.
                XmlElement UpdatesMethod = doc.CreateElement("Method");
                UpdatesMethod.SetAttribute("ID""1");
                UpdatesMethod.SetAttribute("Cmd""Update");
                updates.AppendChild(UpdatesMethod);

                // We need to update a particular row based on its internal ID.

                XmlElement UpdatesField1 = doc.CreateElement("Field");
                UpdatesField1.SetAttribute("Name""ID");        // Which record to update
                UpdatesField1.InnerText = "1";                    // is defined here
                UpdatesMethod.AppendChild(UpdatesField1);

                // We are going to update the field called "Status"

                XmlElement UpdatesField2 = doc.CreateElement("Field");
                UpdatesField2.SetAttribute("Name""Status");    // Which field to update
                UpdatesField2.InnerText = "Status is OK";        // The actual new value
                UpdatesMethod.AppendChild(UpdatesField2);
            
                // Call the web service to update the list items
                XmlNode Result = ListsService.UpdateListItems(ListName, updates);

                ListsService.Dispose();

                Console.WriteLine("The record has been updated!");

                // Sleep for a moment so we can see the results
                System.Threading.Thread.Sleep(5000);
            }
        }
    }

    Make sure you populate the Username, Password, Domain, and ListName variables above. You also need to make sure that the field “Status” exists in the particular list that you are updating. If it does not you will need to change it to a field that does exist.

    For some sample code that will allow you to display the attribute names in a list see - /archive/2005/08/10/197.aspx

    The XmlNode called Result should be parsed to locate errors that may have occurred during the update.


    Step/Step How to retrieve the contents of a Windows SharePoint Services List from c#

    1) Open Visual Studio.NET 2003

    2) New Project (We will create a console application in this demo)

    3) Name your project "GetListItems"

    4) Right Click on "References" under the Project and select "Add Web Reference"

    5) In the URL field type the path to your Windows SharePoint Services Site that contains the list you want to use.

    Each site is different and only contains the lists for the particular child site.

    For example the root site could be called "http://sharepoint.mysite.com" and you could have a sub site called "Test" which is accessible via "http://sharepoint.mysite.com/Test"

    So type in your URL and append the following "_vti_bin/lists.asmx"

    So if you were going to the "Test" child site your URL would be like this:

    http://sharepoint.mysite.com/Test/_vti_bin/lists.asmx

    You may be prompted to log onto your SharePoint site when do perform this action.

    6) Click on "Go" and the Add Web Reference Dialog should display that it found one service and display you some available operations.

    7) Click on "Add Reference"

    8) Now you should end up with a new Web Reference Node in the Solution Explorer and your actual Web Reference which may have a funny name like "com.mysite.sharepoint"

    9) Right click on the Web Reference and rename it to something simple like "SharePoint", this is what we will use to reference the web service in code.

    10) Right click on the Web Reference and select "Properties" and change the "URL Behavior" to "dynamic"

    This will add a "app.config" to the project and populate an appSettings item in the config file so that the URL is dynamically loaded from the "app.config" file and not hard coded into the source of the proxy stub that was created.

    <?xml version="1.0encoding="utf-8"?>
    <configuration>
         <appSettings>
               <add key="GetListItems.Sharepoint.Lists
                  value="http://sharepoint.mysite.com/Test/_vti_bin/lists.asmx"/>
         </appSettings>
    </configuration>

    11) Open the Class1.cs file in the editor and enter the following:

    • Add using System.Net; to the using clause at the top of the page.
    • Add using System.Xml; to the using clause at the top of the page.

    In the Main() function add the following code:

    string Username="MyUsername";
    string Password="MyPassword";
    string Domain="MyDomain";
    string ListName = "MyListName";
    string MaxItemsToReturn = "999";

    Sharepoint.Lists ListsService = new Sharepoint.Lists();
    ListsService.Credentials = new NetworkCredential(Username, Password, Domain);
    XmlNode RootNode = ListsService.GetListItems(ListName, ""nullnull, MaxItemsToReturn, null);

    XmlNamespaceManager Manager = new XmlNamespaceManager(RootNode.OwnerDocument.NameTable);
    Manager.AddNamespace("sp""http://schemas.microsoft.com/sharepoint/soap/");
    Manager.AddNamespace("z""#RowsetSchema");
    Manager.AddNamespace("y""http://schemas.microsoft.com/sharepoint/soap/ois/");
    Manager.AddNamespace("w""http://schemas.microsoft.com/WebPart/v2");
    Manager.AddNamespace("d""http://schemas.microsoft.com/sharepoint/soap/directory/");

    XmlNodeList Nodes = RootNode.SelectNodes("//z:row", Manager);
    foreach(XmlNode Node in Nodes)
    {
     foreach(XmlAttribute attrib in Node.Attributes)
     {
      Console.WriteLine("{0} - {1}", attrib.Name, attrib.InnerText);
     }
     Console.WriteLine();
    }
    ListsService.Dispose();
    // Sleep for a moment so we can see the results
    System.Threading.Thread.Sleep(5000);

    Make sure you populate the Username, Password, Domain, and ListName variables above and then run your code and you should see the attributes that are available and the values for each item in the list.


    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/


    C# Sample code to talk to a printer using SNMP to get its status.

    The following code will allow you to talk to a printer (running on a specific IP Address) to query its current status.

    OLEPRNLib is a COM object that appears to be installed on XP and greater machines.

    On my machine I made a reference on the COM tab of the Add Reference dialog to “oleprn 1.0 Type Library“ which lived in “c:\Windows\System32\oleprn.dll

    using System;
    using OLEPRNLib;
    
    namespace PrinterStatus
    {
     /// 
     /// Summary description for Class1.
     /// 
     class Class1
     {
      /// 
      /// The main entry point for the application.
      /// 
      [STAThread]
      static void Main(string[] args)
      {
       string[] ErrorMessageText = new string[8];
    
       ErrorMessageText[0] = "service requested";
       ErrorMessageText[1] = "offline";
       ErrorMessageText[2] = "paper jammed";
       ErrorMessageText[3] = "door open";
       ErrorMessageText[4] = "no toner";
       ErrorMessageText[5] = "toner low";
       ErrorMessageText[6] = "out of paper";
       ErrorMessageText[7] = "low paper";
    
       int DeviceID = 1;
       int Retries = 1;
       int TimeoutInMS = 2000;
       string CommunityString = "public";
       string IPAddressOfPrinter = "10.3.0.93";
    
       // Create instance of COM object
       OLEPRNLib.SNMP snmp = new OLEPRNLib.SNMP();
    
       // Open the SNMP connect to the printer
       snmp.Open(IPAddressOfPrinter, CommunityString, Retries, TimeoutInMS);
    
       // The actual Warning/Error bits
       uint WarningErrorBits = snmp.GetAsByte(String.Format("25.3.5.1.2.{0}", DeviceID));
    
       // The actual Status
       uint StatusResult = snmp.GetAsByte(String.Format("25.3.2.1.5.{0}", DeviceID));
    
       // uint Result2 = snmp.GetAsByte(String.Format("25.3.5.1.1.{0}", DeviceID));
    
       string Result1Str = "";
       switch (StatusResult)
       {
        case 2 : Result1Str = "OK";
          break;
        case 3 : Result1Str = "Warning: ";
         break;
        case 4 : Result1Str = "Being Tested: ";
         break;
        case 5 : Result1Str = "Unavailable for any use: ";
         break;
        default : Result1Str = "Unknown Status Code : "+StatusResult;
         break;
       }
    
       string Str = "";
       if ((StatusResult == 3 || StatusResult == 5))
       {
        int Mask = 1;
        int NumMsg = 0;
        for (int i=0; i< 8; i++)
        {
         if ((WarningErrorBits & Mask) == Mask)
         {
          if (Str.Length > 0)
           Str += ", ";
          Str += ErrorMessageText[i];
          NumMsg = NumMsg + 1;
         }
         Mask = Mask * 2;
        }
       }
       Console.WriteLine(Result1Str + Str);
      }
     }
    }
    

    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


    Don't use "&id=" as a parameter in your URLs if you want Google to index your pages!

    I came across in interesting observation while looking at the Webmaster Guidelines page on google today.

    • Don't use "&id=" as a parameter in your URLs, as we don't include these pages in our index.

    For more Google guidelines see http://www.google.com/intl/en/webmasters/guidelines.html


    Replacing the scrolling start menu program with multiple columns

    In Windows XP by default the programs displayed in the start menu will scroll, if you want to reset them to be displayed in multiple columns instead of scrolling do the following.

    • Right click the Start Menu, and then select Properties.
    • Choose the Start Menu tab, then click Customize.
    • Select the Advanced tab
    • Scroll down the list of Start Menu Items until you find the entry Scroll Programs and remove the check.
    • Click OK, and nthen click OK again.

    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 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.

    How is this done?

    The way that this is done is the server sends a response to the client making the request. The client then send another request to the new URL. You can not use this type of redirection to retrieve content from another server and deliver it back to the client. The client makes a new connection to the new URL that is returned.

    Below is an example of a HTTP request that is redirected.

    == REQUEST ==================
    GET / HTTP/1.0
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    Accept-Language: en-nz
    Cookie: .DOTNETNUKE=60BB2849F975471BDDBF
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 1.0.3705)
    Host: www.iisfaq.co.nz
    Proxy-Connection: Keep-Alive
    == RESPONSE =================
    HTTP/1.1 302 Object Moved
    Location: http://www.iisfaq.com/forum
    Server: Microsoft-IIS/5.1
    Content-Type: text/html
    Content-Length: 150

    You an see from the Response that the server has sent an HTTP/1.1 302 Object Moved response (the server can also send a 301 Error response - more on that later). This means that the client then reads the location header and makes a new request to that URL.

    How do we actually configure it, and why would we?

    There has been redirection features in Internet Information Server for as long as I can remember and almost every one I speak to does not really know how to use it except in the most basic way. This article should hopefully clarify this feature so we all know how to use it when we want to for specific situations that will occur.

    What types of Redirection is there available?

    Out of the box there is a a pretty simple redirection system employed for IIS.If you are looking for some very specific types of redirection then you may want to investigate ISAPI filters to perform the redirection. An ISAPI filter is a DLL that is configured to process specific requests in the web server. One of those requests can allow us to redirect the user to a different page.

    Where can IIS Redirection be configured?

    We can configure redirections at the following locations in Internet Services Manager:

    • At a Web Site level
    • At a Physical Directory level
    • At a Virtual Directory level
    • At a Physical File level
    • At a Virtual File level.

    Although there are a number of locations that redirections can be configured, the settings are the same for each section so lets just proceed and configure IIS redirection at the Web Site Level.

    How to configure IIS Redirection

    Below is what you see on the Home Directory tab of the Internet Services Manager for a web site on a Windows XP (IIS 5.1) client machine - this is basically the same for IIS 6 (Windows 2003 Server) but IIS 6 supports Application Pools whereas IIS 5.1 (Windows XP) does not. But this article is on Redirection not Application pools so let's proceed.

    Redirection is configured on the Home Directory tab when you are working at the Web Site level.

    IIS Supports getting the content from three locations:

    • A directory located on this computer
    • A share located on another computer
    • A redirection to a URL

    In this article we are going to focus on the last option - A redirection to a URL

    When you click on the option "A redirection to a URL" you get a slightly different looking dialog as shown below (this is a dialog for a Web Site redirection but they basically all look the same except for the tabs displayed).

    So far it looks pretty simple - we can redirect to a URL and we have three additional check box options:

    • The exact URL entered above
    • A directory below this one
    • A permanent redirection to this resource

    So what do they options mean?

    Option 1 - No check box's are checked

    When you configure our web site to the following settings (None of the check box's as checked) the following will occur:

    Redirect To : www.iisfaq.com

    Original URL Requested Redirected URL
    www.iisfaq.co.nz www.iisfaq.com
    www.iisfaq.co.nz/directory1 www.iisfaq.com/directory1
    www.iisfaq.co.nz/directory1/file1.asp www.iisfaq.com/directory1/file1.asp
    www.iisfaq.co.nz/directory1/file1.asp?x=10 www.iisfaq.com/directory1/file1.asp

    Redirect To : www.iisfaq.com/ChildFolder

    Original URL Requested Redirected URL
    www.iisfaq.co.nz www.iisfaq.com/ChildFolder
    www.iisfaq.co.nz/directory1 www.iisfaq.com/ChildFolder/directory1
    www.iisfaq.co.nz/directory1/file1.asp www.iisfaq.com/ChildFolder/directory1/file1.asp
    www.iisfaq.co.nz/directory1/file1.asp?x=10 www.iisfaq.com/ChildFolder/directory1/file1.asp

    This setting is quite simple - in general IIS replaces the original domain portion of the URL with the value in the Redirect to field. But notice that the last option of each group - the parameter x=10 is missing from the new URL! - see Redirection Variables to help resolve this issue!

    Option 2 - The exact URL entered above

    The only difference with the first option and this option is that we have checked the box "The exact URL entered above"

    Redirect To : www.iisfaq.com

    Original URL Requested Redirected URL
    www.iisfaq.co.nz www.iisfaq.com
    www.iisfaq.co.nz/directory1 www.iisfaq.com
    www.iisfaq.co.nz/directory1/file1.asp www.iisfaq.com
    www.iisfaq.co.nz/directory1/file1.asp?x=10 www.iisfaq.com

    Redirect To : www.iisfaq.com/ChildFolder

    Original URL Requested Redirected URL
    www.iisfaq.co.nz www.iisfaq.com/ChildFolder
    www.iisfaq.co.nz/directory1 www.iisfaq.com/ChildFolder
    www.iisfaq.co.nz/directory1/file1.asp www.iisfaq.com/ChildFolder
    www.iisfaq.co.nz/directory1/file1.asp?x=10 www.iisfaq.com/ChildFolder

    You notice that this time any URL as want to navigate to is redirected to exactly the URL we entered in the Redirect to field.

    If you were going to do maintenance on your web site this method is a very good and safe way to redirect users to a maintenance page. No matter what URL they may want to get to they will only be able to get to the URL you specified in the Redirect to field.

    Option 3 - A Directory below this one

    This option is used to redirect a particular file or folder to another location. If you redirect a folder then only if the folder is requested will this redirection do anything.

    Redirect To : /chris.htm    * Note this is a file and not a folder

    Original URL Requested Redirected URL
    www.iisfaq.co.nz www.iisfaq.co.nz/chris.htm/ (causes a 404 error - notice the extra / at the end of the URL unless you have a directory with that name)
    www.iisfaq.co.nz/default.htm www.iisfaq.co.nz/default.htm
    www.iisfaq.co.nz/directory1/file1.asp www.iisfaq.co.nz/directory1/file1.asp
    www.iisfaq.co.nz/directory1/file1.asp?x=10 www.iisfaq.co.nz/directory1/file1.asp?x=10

    Redirect To : /DirectoryX

    Original URL Requested Redirected URL
    www.iisfaq.co.nz www.iisfaq.co.nz/directoryX/
    www.iisfaq.co.nz/?x=10 www.iisfaq.co.nz/directoryX/
    www.iisfaq.co.nz/default.htm www.iisfaq.co.nz/default.htm
    www.iisfaq.co.nz/directory1/file1.asp www.iisfaq.co.nz/directory1/file1.asp
    www.iisfaq.co.nz/directory1/file1.asp?x=10 www.iisfaq.co.nz/directory1/file1.asp?x=10

    Redirect To : http://www.iisfaq.com

    Original URL Requested Redirected URL
    www.iisfaq.co.nz www.iisfaq.com
    www.iisfaq.co.nz/?x=10 www.iisfaq.com
    www.iisfaq.co.nz/default.htm www.iisfaq.co.nz/default.htm
    www.iisfaq.co.nz/directory1/file1.asp www.iisfaq.co.nz/directory1/file1.asp
    www.iisfaq.co.nz/directory1/file1.asp?x=10 www.iisfaq.co.nz/directory1/file1.asp?x=10

    Redirect To : http://www.iisfaq.com/ChildFolder

    Original URL Requested Redirected URL
    www.iisfaq.co.nz www.iisfaq.com/ChildFolder
    www.iisfaq.co.nz/?x=10 www.iisfaq.com/ChildFolder
    www.iisfaq.co.nz/default.htm www.iisfaq.co.nz/default.htm
    www.iisfaq.co.nz/directory1/file1.asp www.iisfaq.co.nz/directory1/file1.asp
    www.iisfaq.co.nz/directory1/file1.asp?x=10 www.iisfaq.co.nz/directory1/file1.asp?x=10

    Option 4 - A Permanent Redirection for this Resource

    When this option is checked IIS sends a specific header to the client browser that specifies that this is a permanent redirection to the new resource location. This is done by sending a "301" Permanent Redirect HTTP response. When this option is not checked the redirections are considered temporary, and the client browser receives a "302" Temporary Redirect HTTP response.

    Some browsers can use the "301" response code as the signal to permanently change a URL, such as a bookmark.

    The following is an example of an HTTP request that is made for a URL

    == REQUEST ==================
    GET / HTTP/1.0
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    Accept-Language: en-nz
    Cookie: .DOTNETNUKE=60BB2849F975471BDDBF
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 1.0.3705)
    Host: www.iisfaq.co.nz
    Proxy-Connection: Keep-Alive
    == RESPONSE =================
    HTTP/1.1 302 Object Moved
    Location: http://www.iisfaq.com/forum
    Server: Microsoft-IIS/5.1
    Content-Type: text/html
    Content-Length: 150

    From the simple HTTP traffic above we see that since we received a 302 Object Moved HTTP Result code that shows the check box "A permanent redirection for this resource" is not checked.

    Here is the same request but this time when "A permanent redirection for this resource" is checked.

    == REQUEST ==================
    GET / HTTP/1.0
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
    Accept-Language: en-nz
    Cookie: .DOTNETNUKE=60BB2849F975471BDDBF
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 1.0.3705)
    Host: www.iisfaq.co.nz
    Proxy-Connection: Keep-Alive
    == RESPONSE =================
    HTTP/1.1 301 Error
    Location: http://www.iisfaq.com/forum
    Server: Microsoft-IIS/5.1
    Content-Type: text/html
    Content-Length: 150

    For more details about HTTP Response Codes see this article : http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

    The actual text values Object Moved and Error are returned on IIS 5.1, the actual HTTP status code is the important piece of the result header.

    Note: The Location header actually tells the browser where the content can now be located.

    Redirect Variables

    You can use redirect variables to pass portions of the original URL with the destination URL.

    Redirection Variable $P

    Passes the parameters in the original URL without the ?

    Redirect To : www.iisfaq.com$P

    Original URL Requested Redirected URL
    www.iisfaq.co.nz www.iisfaq.com
    www.iisfaq.co.nz/directory1 www.iisfaq.com/directory1
    www.iisfaq.co.nz/directory1/file1.asp www.iisfaq.com/directory1/file1.asp
    www.iisfaq.co.nz/directory1/file1.asp?x=10 www.iisfaq.com/directory1/file1.aspx=10

    In this case you notice that $P has removed the original "?" from the redirected URL. Why would you want this? Well one reason could be that you want to specify your own parameters in the Redirect to field.

    Redirect To : www.iisfaq.com/?Redirect=1&$P

    Original URL Requested Redirected URL
    www.iisfaq.co.nz www.iisfaq.com/?Redirect=1&
    www.iisfaq.co.nz/directory1 www.iisfaq.com/directory1/?Redirect=1&
    www.iisfaq.co.nz/directory1/file1.asp www.iisfaq.com/directory1/file1.asp/?Redirect=1&
    www.iisfaq.co.nz/directory1/file1.asp?x=10 www.iisfaq.com/directory1/file1.asp/?Redirect=1&x=10

    Redirection Variable $Q

    Passes the parameters in the original URL including ?

    Redirect To : www.iisfaq.com$Q

    Original URL Requested Redirected URL
    www.iisfaq.co.nz www.iisfaq.com
    www.iisfaq.co.nz/directory1 www.iisfaq.com/directory1
    www.iisfaq.co.nz/directory1/file1.asp www.iisfaq.com/directory1/file1.asp
    www.iisfaq.co.nz/directory1/file1.asp?x=10 www.iisfaq.com/directory1/file1.asp?x=10

    Redirection Variable $S

    Passes the matched suffix of the requested URL. The matched suffix is the portion of the original URL that remains after the redirected URL is substituted.

    In this example we have redirected the folder /Scripts to a new folder /NewScripts

    Redirect To : /NewScripts$S

    Exact URL Original URL Requested Redirected URL

    Not Checked

    www.iisfaq.co.nz/Scripts/script.asp www.iisfaq.com/NewScripts/script.asp/script.asp

    Not Checked

    www.iisfaq.co.nz/Scripts/script.asp?X=10 www.iisfaq.com/NewScripts/script.asp/script.asp

    Checked

    www.iisfaq.co.nz/Scripts/script.asp www.iisfaq.com/NewScripts/script.asp

    Checked

    www.iisfaq.co.nz/Scripts/script.asp?X=10 www.iisfaq.com/NewScripts/script.asp

    Note: Normally the server will automatically perform this substitution and you normally would only use $S in conjunction with another variable.

    Redirection Variable $V

    Pass the requested URL without the server name, but not any parameters.

    Redirect To : /NewScripts$V

    Exact URL Original URL Requested Redirected URL
    not checked www.iisfaq.co.nz www.iisfaq.com/NewScripts
    not checked www.iisfaq.co.nz/default.htm www.iisfaq.com/NewScripts/default.htm/default.htm
    not checked www.iisfaq.co.nz/default.htm?X=10 www.iisfaq.com/NewScripts/default.htm/default.htm
    checked www.iisfaq.co.nz www.iisfaq.com/NewScripts
    checked www.iisfaq.co.nz/default.htm www.iisfaq.com/NewScripts/default.htm
    checked www.iisfaq.co.nz/default.htm?X=10 www.iisfaq.com/NewScripts/default.htm

    I will update this document as I get more details and do more testing. I hope that some of these examples will be of use to you in your redirections with IIS.

     


    Microsoft SQL Server Report Pack for Microsoft Office SharePoint Portal Server 2003
    The Microsoft SQL Server Report Pack for Microsoft Office SharePoint Portal Server 2003 is a set of 8 Microsoft SQL Server 2000 Reporting Services reports that work with a sample database of information extracted from a SharePoint Portal Server environment. This database can be populated from your own SharePoint Portal Server environment using the downloadable Data Extraction Program (DEP). The DEP will read the SharePoint Portal Server data via the object model. You also can use the sample reports as templates for designing new reports.
    This Report Pack includes the following reports:

    • Storage Report
      Shows a listing of the virtual servers and the number of collections, sites, areas, lists, files and size. Also shows a size distribution and storage usage chart, and a top 20 sites based on size.
    • Storage Trend Report
      Shows four charts illustrating the virtual server storage trend, site collection growth trend, area growth trend and list growth trend.
    • Site Trend Report
      Shows hit counts for virtual servers, collections, areas and lists. Also shows the top 20 sites based on hits.
    • Comprehensive Site Collections Report
      Shows the list of site collections, who owns the collection, configurable characteristics about the owner and the date the collection was last accessed.
    • Detailed Site Collection Report
      Shows top 20 pages accessed (based on hit count) for this site collection.
    • Detailed Page Report
      Shows users who have access to the page, when they last accessed it, any referrer URL and number of hits. Also shows two charts illustrating user distribution and referrer distribution.
    • Best Bet Keyword
      Shows top 20, top 10, bottom 10, or bottom 20 keywords used for searching. Also shows which keywords have best bets.
    • Search Terms
      Shows top 20, top 10, bottom 10, or bottom 20 search terms used for searching. Also shows which search terms match a defined keyword.

    http://www.microsoft.com/downloads/details.aspx?FamilyID=49159368-544B-4B09-8EED-4844B4E33D3D&displaylang=en


    Microsoft SQL Server 2005 Upgrade Advisor - CTP June Refresh

    The Microsoft SQL Server 2005 Upgrade Advisor is a tool used by Database developers and administrators to analyze SQL Server 7.0 and SQL Server 2000 database servers in preparation for upgrading to SQL Server 2005. The Upgrade Advisor will allow users to analyze the configuration of their existing database services and database applications. As a result of this analysis, Upgrade Advisor will provide reports that identify deprecated features and necessary configuration changes that will impact their Database upgrade process. Upgrade Advisor will also provide links to documentation that describe these changes and necessary steps to complete the process.

    http://www.microsoft.com/downloads/details.aspx?FamilyID=CF28DAF9-182E-4AC2-8E88-F2E936558BF2&displaylang=en


    Data Protection Manager 2006 Beta

    Top 10 Benefits of Data Protection Manager

    Here are the ten most valuable benefits (plus one bonus benefit) that Data Protection Manager (DPM) can provide to your organization.

    Recover files in minutes instead of hours Recover files in minutes instead of hours

    A typical file recovery from tape takes hours and can be costly. The typical medium data center may have 10 to 20 or more recoveries per month. DPM enables the same recoveries in minutes, saving money for the business and time for IT administrators. Additionally, faster recovery keeps information workers productive because they spend less downtime waiting for their files to be recovered.

    Eliminate the backup window of your production servers Eliminate the backup window of your production servers

    Massive growth in storage capabilities has increased the time needed to back up file servers. At the same time, businesses face the requirement for 24×7 uptime and the fact that there is no good time to perform a backup. Because DPM moves only the byte-level changes of the file servers it backs up, it effectively eliminates the downtime required to back up your file servers. Customers never have to plan for such "backup windows" again.

    Shrink potential data loss down to one hour Shrink potential data loss down to one hour

    With legacy tape backup products, backing up file servers to tape more than once a day is not feasible. Traditionally, full backups are scheduled once per week and incremental backups are performed daily. This requires the use of many tapes, which is a more expensive option than disk-based backup, and creates the risk that any work done between the nightly backups is subject to permanent loss. DPM can back up data to the central DPM server every hour during the day, giving you the security and peace of mind to be able to restore any file object to a previous point in time. You can shrink your potential maximum data loss from a day down to an hour.

    Rely on having no more failed recoveries Rely on having no more failed recoveries

    Given that DPM is a disk-based backup product, the reliability of file restores is significantly better than that of comparative tape-based systems. Recoveries of volumes, shares, folders, and files are virtually guaranteed. DPM also successfully protects even files that are open, which leads to a virtually fault-free backup system.

    Get easy and instant backup verification Get easy and instant backup verification

    Recovering data using disk-based data protection is as fast and simple as browsing a set of folders on a file share and copying them directly from the DPM server to the production server. DPM provides better control of a business's recovery infrastructure so that the IT staff can more rapidly, reliably, and predictably recover data at a lower cost. With disk-based data protection, businesses achieve greater certainty about recovery because IT administrators can verify a successful backup by browsing through the disk and performing an online verification.

    Enable users to perform their own recoveries Enable users to perform their own recoveries

    Recovery and backup processes generally involve multiple administrators, each having unique expertise, adding to the data management total cost of ownership. Corporations collectively spend billions of dollars annually on recovering lost data. DPM solves these problems by enabling self-service user recovery, which lets users access and retrieve files directly within Microsoft Windows XP and Microsoft Office XP applications without administrator intervention, thereby lowering administrator costs and increasing productivity.

    Set up and protect your file servers in minutes Set up and protect your file servers in minutes

    As new servers and shares are added to the network, DPM automatically discovers and alerts the administrator that unprotected servers exist in the environment. By using comprehensive wizards, the administrator can easily set the protection schedule. Backups of the data then occur according to the schedule and the server administrator does not need to initiate the backup process. DPM enables you to automatically discover and protect new servers and shares added to your environment in minutes.

    Use advanced functionality at low cost Use advanced functionality at low cost

    In many organizations, the data storage budget consumes up to one-third of the total IT budget. Furthermore, a significant share of the IT storage budget is related to backup and recovery. According to estimates, 70 percent of the cost of backup and recovery over a three-year period is related to manual labor costs. Fast, easy, and cost-effective data protection and recovery methods are crucial to lowering overall IT costs. DPM works with Microsoft Windows Server 2003 and Windows 2000 Server file server technologies to deliver low total cost of ownership by overcoming the deficiencies and cost of tape-based backup systems—essential objectives of enterprise computing infrastructures. DPM includes an exciting set of customer-focused services to increase return on investment and enhance user productivity.

    Remove tapes from branch offices and centralize backups at the data center Remove tapes from branch offices and centralize backups at the data center

    Today, the primary way to protect remote servers is for branch office staff to back up data to expensive removable media, such as data tape cartridges, and then manually transport the media to an offsite storage facility. Tape restores within this configuration can be expensive and slow. DPM deploys agents on the remote file servers to send the data back to the central data center where it can be more securely backed up by one IT administrator.

    Take advantage of rich out-of-the-box reporting and monitoring functionality Take advantage of rich out-of-the-box reporting and monitoring functionality

    Because DPM is part of the Windows Server System, it contains tools that are already in your server software, such as Microsoft Management Console (MMC) and Windows Explorer. IT administrators are already familiar with these tools, which reduces training costs. Along with the comprehensive report functionality included with the product, DPM can also upload all of its reports and alerts to the Microsoft Operations Manager console.


    Bonus Benefit

    Save time with simple, easy-to-schedule backup management

    By using comprehensive wizards, the administrator can easily set a protection schedule specific to the servers being protected. Backups of the data then occur according to the schedule, ensuring that snapshots of the data are taken at the predetermined times. This creates nearly instantaneous shadow copies that can be stored on the DPM server and be further transferred to the tape backup during the regularly scheduled backup process, ensuring a comprehensive backup strategy for your company.

    http://www.microsoft.com/windowsserversystem/dpm/default.mspx


    SyncToy v1 Beta for Windows XP

    Increasingly, computer users are using different folders, drives, and even different computers (such as a laptop and a desktop) to store and retrieve files. There are new sources of files coming from every direction: digital cameras, e-mail, cell phones, portable media players, camcorders, PDAs, and laptops. Yet managing hundreds or thousands of files is still largely a manual operation. In some cases it is necessary to move files from one place to another; in other cases there is a need to keep two storage locations exactly in sync. Some users manage files manually, dragging and dropping from one place to another and keeping a mental card catalog in their heads. Others use one or more applications of one sort or another to provide this functionality for them.

    Now there is an easier way. SyncToy is a free PowerToy for Microsoft Windows XP that provides an easy to use, highly customizable program that helps users to do the heavy lifting involved with the copying, moving, and synchronization of different directories. Most common operations can be performed with just a few clicks of the mouse, and additional customization is available without adding complexity. SyncToy can manage multiple sets of directories at the same time; it can combine files from two folders in one case, and mimic renames and deletes in another. Unlike other applications, SyncToy keeps track of renames to files and will make sure those changes get carried over to the synchronized folder

    http://www.microsoft.com/downloads/details.aspx?FamilyID=E0FC1154-C975-4814-9649-CCE41AF06EB7&displaylang=en


    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

    Microsoft has released 30 new site Windows Sharepoint Services templates for business applications

    These application templates are tailored to address the needs and requirements for specific business processes or sets of tasks for organizations of any size. The applications are the first out-of-box custom scenarios for the Windows SharePoint Services platform, though they also provide a starting point for partners and developers looking to build deeper Windows SharePoint Services solutions.

    Absence and Vacation Schedule
    Board of Directors
    Case Work Management
    Change Management
    Classroom Management
    Competitive Intelligence
    Employee Activities Site
    Employee Timesheet and Scheduling
    Employee Training
    Event Coordination
    Expense Reimbursement
    Help Desk
    HR Programs and Services
    IT Developer Team Site
    Legal Document Review Workflow
    Loan Initiation Management
    Marketing Campaigns
    Meeting Management
    New Product Development
    Performance Review
    Professional Svcs Contracts
    Professional Svcs Site
    Project Team Site
    Public Official Activity
    Public Relations Work Site
    Publication Editorial Review
    Recruiting Resource Center
    Request for Proposal Management
    Room and Equipment Reservation
    Travel Request

     


    Colorise Source Code into HTML

    If you are wanting to colorise Source Code into HTML the following free services are quite good.


    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 )