Article ID: 252490 - View products that this article applies to.
This article was previously published under Q252490
A User Principal Name (UPN) is composed of a user account logon name and the user principal name suffix joined by the "@" sign. The UPN allows for a simplified logon. Most commonly, the UPN is the user's e-mail address. Because the user principal name provides the ability to perform a single logon anywhere in the enterprise, the UPN is required to be unique across the entire Microsoft Windows 2000 forest. This is achieved by querying the Global Catalog for an existing user with that UPN.
This article contains code samples written in Microsoft Visual Basic and Microsoft Visual C++ that demonstrate how to query the Global Catalog for a UPN.
Before setting a UPN for a new or existing user, the Global Catalog should be queried. The Active Directory Users and Computers Microsoft Management Console (MMC) snap-in queries the Global Catalog, as should any other application making modifications to the UPN. Although querying the Global Catalog does not absolutely guarantee that a UPN is unique across the enterprise, it is a recommended practice that greatly reduces the chances of duplication. Following is a Microsoft Visual Basic/VBScript code example that uses Active Directory Services Interfaces (ADSI) Lightweight Directory Access Protocol (LDAP) provider to query the Global Catalog for a UPN:
Following is a similar example for use in Microsoft Visual C++:
For information about duplicate user principal names see the following article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/251359/EN-US/ )PRB: Possible Duplicate User Principal Names
For additional information about Active Directory Services Interfaces (ADSI), see the following web site:
For code examples of retrieving UPN suffixes, creating users, and modifying UPNs, see the samples and documentation located in the Platform SDK, which is available from the following Microsoft Web site:
Article ID: 252490 - Last Review: October 12, 2007 - Revision: 3.7