What is the difference between user principal name and same account name

banu111
banu111 used Ask the Experts™
on
Can anybody explain what is the difference.
I am working on an project where I am using
Userprincipal.Getattribute("samaccountname");
Userprincipal.Getattribute("userprincipalname");
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
samaccountname = User logon name
userprincipalname = User logon name + (UPN) suffix

UPN logon looks just like an email address.

Commented:
here is a basic difference



Applies to: desktop apps only
The logon name used to support clients and servers running earlier versions of the operating system, such as Windows NT 4.0, Windows 95, Windows 98, and LAN Manager. This attribute must be less than 20 characters to support earlier clients.
CN      SAM-Account-Name
Ldap-Display-Name      sAMAccountName
Size      Less than 20 characters.
Update Privilege      Domain administrator
Update Frequency      This value should be assigned when the account record is created, and should not change.
Attribute-Id      1.2.840.113556.1.4.221
System-Id-Guid      3e0abfd0-126a-11d0-a060-00aa006c33ed
Syntax      String(Unicode)




Applies to: desktop apps only
This attribute contains the UPN that is an Internet-style login name for a user based on the Internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember. By convention, this should map to the user email name. The value set for this attribute is equal to the length of the user's ID and the domain name. For more information about this attribute, see the Naming Properties topic in the Active Directory guide.
CN      User-Principal-Name
Ldap-Display-Name      userPrincipalName
Size      -
Update Privilege      Domain administrator or account owner.
Update Frequency      In theory this should never change.
Attribute-Id      1.2.840.113556.1.4.656
System-Id-Guid      28630ebb-41d5-11d1-a9c1-0000f80367c1
Syntax      String(Unicode)


UPN has no character limit
UPN is typically the email address  (username @ domain,
    as oppsed to the SAN which is a short version of the username


hope this helps

ref:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms680857(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/ms679635(v=vs.85).aspx
Photographer
Awarded 2007
Top Expert 2008
Commented:
Put simply if you have a domain called mydomain.com and you have a user with a username of fred, then the User Principal name is fred@mydomain.com

The username must be unique in the domain
The UPN must be unique in the forest.
Anuradha GoliSystems Development / Support Specialist

Commented:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms677605(v=vs.85).aspx

Applies to: desktop apps only
This attribute contains the UPN that is an Internet-style login name for a user based on the Internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember. By convention, this should map to the user email name. The value set for this attribute is equal to the length of the user's ID and the domain name. For more information about this attribute, see the Naming Properties topic in the Active Directory guide.
CN      User-Principal-Name
Ldap-Display-Name      userPrincipalName
Size      -
Update Privilege      Domain administrator or account owner.
Update Frequency      In theory this should never change.
Attribute-Id      1.2.840.113556.1.4.656
System-Id-Guid      28630ebb-41d5-11d1-a9c1-0000f80367c1
Syntax      String(Unicode)

Commented:
lol  

@anuradhay, you did NOT just re paste half of my answer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial