Article ID: 103390 - Last Review: February 20, 2007 - Revision: 4.4 Network access validation algorithms and examples for Windows Server 2003, Windows XP, and Windows 2000
This article was previously published under Q103390 On This Page The following is a simplified algorithm that explains how
Windows account validation is observed to function during network access using
the NTLM protocol. It is using access through the server message block (SMB)
protocol as the example, but it applies to all other server applications that
support NTLM authentication. This discussion does not cover the internal
workings of this process. With this information, you can predict Windows
network logon behavior under deterministic conditions. When Kerberos is used to authenticate the user and obtain
access to server resources, the process is very different from what NTLM does.
For more information, visit the following Microsoft TechNet Web site: http://technet2.microsoft.com/WindowsServer/en/Library/f5c70774-25cd-4481-8b7a-3d65c86e69b11033.mspx
(http://technet2.microsoft.com/WindowsServer/en/Library/f5c70774-25cd-4481-8b7a-3d65c86e69b11033.mspx)
Remember that the local database is the domain database and the
only database on the domain controllers. But on other servers and all
computers, the local database differs from the domain controller. Background informationWhen two Windows Server 2003-based, Windows XP-based, or Windows 2000-based computers communicate over a network, they use a high-level protocol called server message block (SMB). SMB commands are embedded in the transport protocols, such as NetBIOS Enhanced User Interface (NetBEUI) or TCP/IP. For example, when a client computer performs a NET USE command, an "SMB Session Setup and X" frame is sent out.In Windows, the "Session Setup" SMB includes the user account, a hash function of the encrypted password and logon domain. A domain controller will examine all this information to determine whether the client has permissions to complete the NET USE command. AlgorithmsA Windows client computer sends the following command to a server:NET USE x: \\server\share The server examines the domain name or computer name that was specified by the SMB. If the name is the server's own name, the following algorithm is run:
It checks its own domain database or computer database for
a matching account.
If it finds a matching account then
The SMB password is compared to the domain database password or the computer database password.
If the password matches then
The command completed successfully.
If the password does NOT match then
The user is prompted for a password.
The password is retested as above.
System error 1326 has occurred. Logon failure: unknown
user name or bad password.
End
If it does NOT find the account in the domain Security Accounts Manager (SAM) database or computer SAM database then
Guest permissions are tested.
If the guest account is enabled
The command completed successfully.
If the guest account is disabled
(* See Note a).
The user is prompted for a password.
System error 1326 has occurred. Logon failure:
unknown user name or bad password.
End
The server will do pass-through authentication. The
network logon request will be sent to a server that has a domain controller role in the
specified trusted domain.
The trusted domain controller checks its own domain database
for a matching account.
If the trusted domain controller finds a matching account, then
NOT for Windows 2000 and later versions:
It determines whether the account is a local or global account.
If the account is local, then
Guest permissions on the original server are tested.
If the guest account is enabled
The command completed successfully.
If the guest account is disabled
(* See Note a) The user is prompted for a password.
System error 1326 has occurred. Logon failure:
unknown user name or bad password.
End
If the account is global (the only option for Active Directory)
The SMB password is compared to the domain database
password.
If the password matches, then
The command completed successfully.
(* See Note b)
If the password does NOT match, then
The user is prompted for a password.
The password is retested as above.
System error 1326 has occurred. Logon failure:
unknown user name or bad password.
End
If the trusted domain controller does NOT find the account in the trusted domain controller
database, then
Guest permissions are tested on the original server, not the trusted domain. (* See Note c)
If the guest account is enabled
The user will have original server guest access.
The command completed successfully.
If the guest account is disabled
(* See Note a) The user is prompted for a password.
System error 1326 has occurred. Logon failure:
unknown user name or bad password.
End
It will check its own account database for
a matching account
If the server finds a matching account, then
The SMB password is compared to the domain database password or the computer database password.
If the password matches, then
The command completed successfully.
If the password does NOT match, then
The user is prompted for a password.
The password is retested as above.
System error 1326 has occurred. Logon failure: unknown
user name or bad password.
End
If it does NOT find the account in the domain database then
guest permissions are tested.
If the guest account is enabled
The command completed successfully.
If the guest account is disabled
System error 1326 has occurred. Logon failure:
unknown user name or bad password.
End
The server will treat this a local network logon. The server
will test for a matching account in its own database.
If it finds a matching account, then
The SMB password is compared to the SAM database password.
If the password matches, then
The command completed successfully.
If the password does NOT match, then
The user is prompted for a password.
The password is retested as above.
System error 1326 has occurred. Logon failure: unknown
user name or bad password.
End
If it does NOT find the account in the local SAM database AND
LsaLookupRestrictIsolatedNameLevel=0, then (* See Note d)
The server will simultaneously ask each domain that it trusts whether it has account that
matches the SMB account.
The first trusted domain to reply is sent a request to
perform pass-through authentication of the client
information.
The trusted domain will look in its own database.
If an account that matches the SMB account is found, then
The trusted domain determines whether the account is a local or global
account.
Not for Windows 2000 and later versions:
If the account is local then
Guest permissions on the original server are tested.
If the guest account is enabled
The command completed successfully.
If the guest account is disabled
The user will be prompted for a password.
Regardless of what password is entered, the user will receive
"Error 5: Access has been denied."
End
If the account is global (the only option for Active Directory)
The password that was specified in the SMB is compared
to the SAM database password.
If the password matches, then
The command completed successfully.
If the password does NOT match, then
The user is prompted for a password.
The password is retested as above.
System error 1326 has occurred. Logon failure:
unknown user name or bad password.
End
If no trusted domains respond to the request to identify the
account, then
Guest permissions are tested on the original server,
not the trusted server.
If the guest account is enabled
The command completed successfully.
If the guest account is disabled
System error 1326 has occurred. Logon failure:
unknown user name or bad password.
End
Notes
ExamplesThe following are examples of these algorithms in action.Example 1You are logged on to the computer by using the same account name and password that is in the SCRATCH-DOMAIN domain account database. When you run the NET USE \\SCRATCH command for the domain controller for the SCRATCH-DOMAIN domain, the command is completed successfully. When you run the NET USE \\NET command for the domain controller that trusts the SCRATCH-DOMAIN domain, you receive the following error message:System
error 1326 has occurred. Logon failure: unknown user name or bad
password. Note This example assumes the following configurations. Configurations Computer that has a local security authority: -Login account: USER1 -Password: PSW1 -Login Domain: LOCAL1
-Server Name: NET</WWITEM>
-Domain: NET-DOMAIN</WWITEM>
-Trust: NET-DOMAIN Trust SCRATCH-DOMAIN (Therefore,
accounts on SCRATCH-DOMAIN can be granted permissions
in the NET- DOMAIN).
-Server Name: SCRATCH -Domain: SCRATCH-DOMAIN -Domain Database contains account: USER1 -Domain Database contains password: PSW1 Example 2When you run the NET USE x: \\NET\share command, the following steps occur:
Example 3When you run the NET USE x: \\SCRATCH\sharecommand, the following steps occur:
The ideal solution is to have all computers log on to a domain. In order to log on, the user must specify the domain, account, and password. After you do this, all NET USE-type commands will pass the correct domain, account, and password information. Administrators should try to avoid duplicate accounts on both computers and multiple domains. Windows Server 2003-based, Windows XP-based, and Windows 2000-based computers help avoid this configuration by using trusts between domains and by using members that can use domain databases. WorkaroundThere is one workaround that can be used in these cases. From the computer, you could run the following command:
NET USE X: \\NET\SHARE /USER:SCRATCH-DOMAIN\USER1 PSW1
In this command, the follow is true:
- \\NET = The computer name of the domain controller being accessed.
- \SHARE = The share name.
- /USER: command line parameter that lets you specify the domain,
account and password that should be specified in the "Session Setup"
SMB.
- SCRATCH-DOMAIN = Domain name of the domain where the user
account resides.
- \USER1 = account to be validated against.
- PSW1 = password that matches account on the domain.
NET USE /?
NULL domain namesThe Microsoft SMB client that is included in Windows Server 2003, Windows XP, and Windows 2000 sends NULL domain names in the "Session Setup SMB [x73]" SMB. The Microsoft SMB client handles the domain name by specifying the logon domain name and by sending a NULL character if the domain name is not specified in the NET USE command. The Microsoft SMB client will also exhibit the behavior described in Example 1.Notes
TroubleshootingA good tip for troubleshooting network access problems is to enable auditing by doing the following.Windows 2000 and later versions of Windows 2000-based domain controllers
Domain settings for Windows 2000 servers and members
Local settings for Windows 2000 servers and members
For more information about trust relationships, pass-through authentication, user permissions, and domain logins, see the "Technical Overview of Windows Server 2003 Security Services." To do this, visit the following Microsoft Web site: http://www.microsoft.com/windowsserver2003/techinfo/overview/security.mspx
(http://www.microsoft.com/windowsserver2003/techinfo/overview/security.mspx)
APPLIES TO
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|





















Back to the top