Information in this document, including URL and other Internet Web site references, is subject to change without notice. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.
© 2004 Microsoft Corporation. All rights reserved.
Microsoft, Windows, and Windows Server are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
The names of actual companies and products mentioned herein may be the trademarks of their respective owners.
| Overview | Main | Notes | Syntax | Examples | Related Tools |
Authentication and Access Control Diagnostics (Authdiag) Version 1.0 allows you to review, test, and correct problems with Internet Information Services (IIS) authentication and authorization. You can use Authdiag to check settings on Web sites, FTP sites, virtual directories, Web directories, and files. Authdiag can help you troubleshoot the following types of issues:
Authdiag provides both user interface (UI) and command-line modes of operation. Both modes are used for troubleshooting authentication and authorization problems on a local server. Both the UI and command-line modes allow you to troubleshoot a single failure or multiple failures. Each time you run Authdiag, the tool stores all transactions in a History folder, so you have a record of the results of your queries.
Authdiag is compatible with the following operating systems and IIS versions:
For the latest information about Authdiag, see Authentication and Access Control Diagnostics Version 1.0.
© 2004 Microsoft Corporation. All rights reserved.
This section explains how to use Authdiag to troubleshoot IIS authentication and authorization issues. This section contains the following topics:
This section explains how to perform basic Authdiag tasks.
|
To install Authdiag
|
|
To open AuthDiag from the Programs menu
|
|
To open Authdiag from the command line
For more information about running Authdiag from the command line, see Syntax. |
|
To configure Authdiag display properties
|
|
To copy Authdiag results
|
|
To print the data displayed in the Authdiag window
|
|
To go back to the Authdiag main page
|
|
To close Authdiag
|
|
To uninstall Authdiag
|
This section explains how to use Authdiag to check authentication failures on the computer where Authdiag is installed. Authdiag uses credentials provided by IIS to check anonymous authentication. You can provide credentials through the UI for testing other authentication methods. Authdiag uses a predefined set of criteria to test the following authentication methods:
Note
|
|
To check Web or FTP site authentication
|
|
To test authentication for a specific user
|
|
To check Kerberos authentication
|
This section explains how to use Authdiag to check directory or file access failures. Authdiag checks NTFS effective permissions, which are the sum of the NTFS permissions assigned to the user account and to all of the groups to which the user belongs. However, Authdiag does not detect share permissions that override NTFS effective permissions.
|
To check Web or FTP site permissions for a specific user
|
|
To view file system permissions for a Web or FTP site's directory structure
|
|
To view or change site properties
|
|
To view or change file system permissions
|
|
To view or change user rights
|
|
To view or change user and group accounts
|
If Authdiag does not detect any failures or warnings when it checks site configuration settings, you can use the Authmon feature to monitor failures on a single URL. Authmon retrieves the following information from a process that is currently running:
Authmon monitors critical calls for authentication and authorization and sends them to a log file called Authmon.log. This file is stored in the directory where Authdiag is installed. For more information on Authmon, see Authmon Reference.
This section explains how to use the Authmon feature of Authdiag to troubleshoot URL failures.
|
To monitor URL failures
|
This section explains how to save Authdiag results to a log file. Authdiag logs can be saved as .log files, .xml files, or .txt files. For an example of log file formats, see Authdiag Output Formats.
|
Note
|
|
To save information to a log file
|
|
To open a log file for analysis
|
© 2004 Microsoft Corporation. All rights reserved.
This topic contains the following information:
The following table describes authentication and authorization issues Authdiag can help you resolve.
| Issue | Example |
|---|---|
| "Access Denied" errors caused by NTFS authorization failures. | Access failures based on a user token; for example, 401.3 errors. |
| "Access Denied" errors caused when an authenticated user does not have the correct user rights. | One of the following user rights might be missing:
|
| "Access Denied" errors caused by incorrect permissions for registry keys. | IIS 5.0 and 5.1:
|
| "Access Denied" errors based on incorrect configuration of IIS metabase. | No Read or Write access to metabase property, resulting in a 403.2 error. |
| Authentication failure based on invalid configuration. |
The following authentication types can fail for the following reasons:
|
| Configuration issues related to IIS communication with a remote UNC server, as well as configuration issues with the UNCUserName or UNCUserPass metabase properties. |
|
| Problems with system default permissions for IIS. These failures would be based on any incorrect permissions to directories such as those listed here. |
|
| Failure within an Active Server Page (ASP) file based on failed permissions. | Calls to CoCreateInstance in Inetinfo.exe or W3WP.exe. See the Examples section for scenarios. |
| Failure to access home directory or FTProot because the accessing role, for example, Anonymous User or Authenticated User, does not have the appropriate permissions. |
|
The following table shows the status messages Authdiag returns while running and upon completion.
| Status Message | Description |
|---|---|
| Success: Log Created | Defines the end of execution and allows you to open the log file. |
| Status…Executing <command> | Provides status while the tool is running. <command> contains the command you entered on the command line, for example:
Authdiag - L:xml -url:http://localhost |
| Failure: Error | Displays the error message and reason why the log file was not created. |
Authdiag displays one of the following error messages in response to the appropriate error:
| Error Message | Description |
|---|---|
| %InvalidSyntax% | The command syntax is not valid. For valid syntax, type the following command at the command prompt: |
| %UserPass% (Invalid User or Password) | The user specified on the -p parameter does not exist on the system, or the password for that user is not valid. |
| %InvalidDir% (Invalid Directory) | The - d parameter points to a directory that is not valid or not specified. An example of the valid format for a directory path is C:\Inetpub\wwwroot. |
Authdiag allows you to save the results of authentication or authorization checks as log files. Log files can be saved as .log, .xml, or .txt files. You can use any text editor to read a log file.
The following example shows Authdiag results that have been saved as a .log file:
|
The following example shows the schema for Authdiag XML output (.xml files):
|
The following example shows the format of an Authdiag history file. The History folder is located in the directory where Authdiag is installed.
|
Problems with authentication and authorization can be caused by changes to user rights or conflicts with Group Policy settings. With Authdiag, you can view the assigned user rights to ensure that your server is configured correctly.
The following table shows default user rights for IIS 5.0 and IIS 5.1.
| User or Group | Default User Rights |
|---|---|
| BUILTIN\Administrators |
|
| BUILTIN\Users |
|
| IUSR_ComputerName |
|
| IWAM_ComputerName |
|
| ASPNET |
|
| Everyone |
|
| NTAuthority\Service |
|
| NTAuthority\Network |
|
The following table shows the default user rights for IIS 6.0.
| User or Group | Default User Rights |
|---|---|
| BUILTIN\Administrators |
|
| BUILTIN\Users |
|
| IUSR_ComputerName |
|
| IWAM_ComputerName |
|
| ASPNET |
|
| Everyone |
|
| NTAuthority\Service |
|
Authmon checks real-time authentication or authorization requests for a URL you want to monitor. Because this check occurs within the Authdiag tool, Authmon must stop the process that is currently running, and then restart the process to begin monitoring. When you select Monitor URL Failures from the Tasks list, a warning message is displayed to explain how Authmon works. You can either choose to run Authmon by clicking Continue or choose another task to perform. You can disable the warning message by selecting Disable Authmon Warning from the Options list on the File menu.
The following table shows how Authmon works with each version of IIS.
| Operating System and IIS Version | Behavior |
|---|---|
|
|
| Windows Server 2003 with IIS 6.0 running in worker process isolation mode |
|
Authmon presents the following information for you to analyze:
| Information | Description |
|---|---|
| HTTP or FTP verb sent to the server | Helps determine whether Internet Server APIs (ISAPIs) or WebDAV are involved in the request. Examples of verbs include Get, Post, Put, and Delete. |
| URL being monitored | Specifies that only requests for this URL are monitored. Paths can include /, /vdir, or /vdir/file. |
| Current authorization header being sent (if applicable) | Verifies that faulty headers are not being sent for authentication. |
| The impersonating user | Shows the user who is running the IIS worker process. |
| Thread identity obtained from the authorization header | Displays the user who is attempting to access the resource. |
| The call being monitored (for example, CreateFile) | Displays the specific resource being called. Tip: If you see calls to iisreset and you are running IIS 6.0, you are running in IIS 5.0 isolaiton mode. |
| Status of the URL request | Displays Success or Failed (with associated error). |
The following example shows an excerpt from an Authmon log file in XML format. In this example, Authmon has detected that an ASP file calls an include file, Header.asp. The Hheader.asp file does not have the appropriate ACLs for anonymous access, so the call to the file results in an "Access denied" error.
|
© 2004 Microsoft Corporation. All rights reserved.
In command-line mode, Authdiag uses the required parameters shown in the following table.
| Required Command-Line Parameter | Description | Example |
|---|---|---|
-l:<log|xml> |
Specifies that command-line mode is to be used. Optionally, you can specify xml to create a log in XML format. By default, if -l is specified by itself, the default .log format is used. |
authdiag -l -url:http://localhost
This command creates the Authdiag.log file in the current directory and displays permissions for w3svc/#, which is localhost, the default Web site on the current computer. A copy of the log file is also stored in the History folder under the directory where Authdiag is installed. |
- url:http://<path> |
Specifies the URL to be checked. | authdiag -l xml -url:http://localhost/newvdir
This command creates the Authdiag.xml file in the current directory and displays permissions for the newvdir folder under the default Web site. A copy of the log file is also stored in the History folder under the directory where Authdiag is installed. |
The following table describes optional parameters you can use with Authdiag in command-line mode.
| Optional Command-Line Parameter | Description | Example |
|---|---|---|
-u:<User|Group> string |
Specifies the user name or group name whose authentication settings you want to check. | authdiag -1 -url:http://localhost -u:User1
This command specifies that a log file in the default .log format should be created in the current directory and permissions for the specified user on the specified directory should be checked. A copy of the log file is also stored in the History folder under the directory where Authdiag is installed. |
-p:<Password formatted as a string of asterisks (*)> |
Specifies the password for the user whose authentication settings you want to check. | authdiag -l -url:http://localhost -u:User1 -p:********
This command specifies that a log file in the default .log format should be created in the current directory. Both authentication and permissions for the specified user on the specified directory will be checked. A copy of the log file is also stored in the History folder under the directory where Authdiag is installed. |
-analyze |
Performs the same function as the Check Authentication task on the UI. You can also provide a user name and password so Authdiag can verify the user and attempt to log on to the site. | authdiag -l -url:http://www.contoso.com/salesweb/newvdir -analyze
This command checks authentication for the Web site specified by the
This command checks authentication for the Web site specified by the |
-authmon:<start|stop> |
Starts the Authmon feature of Authdiag. It does not, however, generate any requests; you must manually enter the requests you want to test against the specified URL. The Authmon feature remains running until you run the authdiag command with the -authmon:stop option. |
authdiag -l -url:http://www.contoso.com/salesweb -monitor:start authdiag -l -url:http://www.contoso.com/salesweb -monitor:stop |
-d:<Path> |
Specifies that you want to check permissions for the directory name given in the path. If you specify this parameter without the -u parameter, Authdiag displays all permissions for the path. If you specify the -u parameter, Authdiag checks path permissions for that particular user. |
authdiag -l -d:"c:\inetpub\wwwroot"
This command specifies that a log file in the default .log format should be created in the current directory. All permissions for the given path will be displayed. A copy of the log file is also stored in the History folder under the directory where Authdiag is installed. |
© 2004 Microsoft Corporation. All rights reserved.
This topic describes the following authentication and permission failure scenarios that Authdiag can help you troubleshoot:
Authentication failures are generally caused by the lack of a valid user name, password, or configuration in the IIS metabase. If administrators cannot manage the remote account database, such as Active Directory or Netware Directory Services, they cannot ensure that the credentials added to the IIS metabase are valid and accurate. For example, suppose the problem involves metabase properties such as AnonymousUserName or UNCUserName. The failure might be a result of one of the following error situations:
For these situations, IIS returns a generic 401.1 "Login Failed" error message.
File access permissions cause most of the problems that confront IIS administrators. Often, permission failures occur because content, system files, or components are not secured with the appropriate access control list (ACL) permissions. A common example of this problem is the FTP client without NTFS Write permission. Access can also fail because share permissions are not correctly set.
Troubleshooting permission failures is challenging because it is difficult to determine where the permission failure occurred. It might occur during an attempt to open a handle to the file itself (for example, Default.asp), or to subsequent files such as Asp.dll or Vbscript.dll, or to a file on a remote share that the user does not have permission to access.
Windows user rights that are not configured correctly can lead to an IIS failure and a 401.3 error. If a policy is applied on the IIS server, and that policy does not allow users to log on locally to the server, this scenario could occur.
IIS versions prior to IIS 6.0 place more reliance on having certain user rights for built-in accounts such as IUSR_ComputerName or IWAM_ComputerName. There can be many root causes for this type of failure, but this scenario is often caused if the following user rights do not exist:
Errors in Web page display can often be traced to file access permissions that are incorrectly configured in the IIS metabase. IIS verifies access permissions for directories that include static content, such as .htm, .html, .jpg, and .zip files. You must configure Read access in the metabase for these directories, for either the anonymous user account or a domain account for a specific user. However, for directories that contain dynamic content, such as scripts or .asp files, you do not need to configure Read access in the metabase. This is because requests for dynamic content are passed to a component other than IIS, and that component is responsible for verifying file access permissions.
Incorrect file access permissions can cause page-access errors because some dynamic content contains nested files, such as include (.inc) files, that might call static files. If the Read property for these static files is not enabled in the metabase, or is not inherited from a higher-level folder, not all components of a Web page will be displayed correctly.
Similarly, files that have Write permission configured in the metabase can create a security risk, unless the anonymous user account requires this access. Web Distributed Authoring and Versioning (WebDAV) is one example where the anonymous account requires Write access to specific directories and files.
Kerberos configuration presents complicated troubleshooting scenarios. If you run IIS 6.0 in worker process isolation mode, application pools can be configured to run under custom domain accounts instead of the default Network Service account. In this situation, Kerberos configuration breaks because the custom domain account is not registered as a Service Principal in Active Directory.
In this scenario, an administrator configures an application pool to run as domain user fabrikam\user1. The administrator assumes that to run the application pool the only membership required is in the IIS_WPG group, so the user is added to that group. The worker process then starts successfully.
Soon, however, the administrator begins to receive complaints of failure when users attempt to access .asp or .aspx pages. Troubleshooting reveals that users are not authenticating using Kerberos; instead, they are reverting to NTLM. However, because NTLM tokens cannot be delegated, the access fails. Kerberos troubleshooting determines that the Service Prinicipal Name (SPN) is not registered correctly, because the worker process identity was changed from the default Network Service to a custom domain account. To correct this problem, the Domain Administrator must use the Setspn.exe tool to register the custom domain account as the SPN. Setspn.exe is included in the Windows Server 2003 Support Tools. For more information about Kerberos, see Troubleshooting Kerberos Delegation.
FTP user isolation, a new feature in IIS 6.0, allows complete isolation of authenticated users. Any configuration errors return the "Home Directory Inaccessible" error message, which might cause users or administrators to assume that they do not have the correct permissions to access the FTP resource.
The correct way to set up local user isolation (that is, outside of Active Directory) is to create the following hierarchy:
Path = FTP Root Directory (c:\inetpub\ftproot)
LocalPath = Top-Level for Local Users (C:\inetpub\ftproot\LocalUser)
DomainPath = Top-Level for Domain Users (C:\inetpub\ftproot\Fabrikam)
User Home Directory = Directory for the user (not a virtual directory) (c:\inetpub\ftproot\LocalUser\FabrikamUser)
Without this configuration, users cannot log on to an FTP resource, because for anonymous access, user isolation requires the presence of either home directories or a public directory.
To strengthen security, administrators apply security policies or ACLs to the following system directories:
Any directory that is a child directory of %windir% inherits permissions from %windir% by default. If you choose to override the ACLs on child directories, IIS may fail to correctly serve ISAPI filter or ISAPI extension requests, including requests made by ASP.
For more information about default installation permissions for new installations of IIS, see articles Q271071, "HOW TO: Set Basic NTFS Permissions for IIS 5.0" and Q812614, "INFO: Default Permissions and User Rights for IIS 6.0," in the Microsoft Knowledge Base.
Note
|
© 2004 Microsoft Corporation. All rights reserved.
Permissions Verifier version 1.0 allows you to define a group of tasks that check permissions and user rights, and to select which tasks will execute at run time. Permissions Verifier provides sample XML files that you can use to verify permissions on a server running Internet Information Services (IIS). You can extend these sample files to enable the tool to check ACLs and permissions for users and groups. This allows you to verify that permissions issues are not causing Web server problems.
You can further customize the sample XML configuration files to add tasks and to change the tasks that are performed. In addition, you can create new XML configuration files and define new tasks and XML tags.
Permissions Verifier can perform five predefined tasks, which are specified in the sample XML configuration files installed with the tool: