locked
Differences between Principle.Name & Principle.SamAccountName RRS feed

  • Question

  • User-540818677 posted

    I am working with an asp.net mvc web application. and I am retrieving a list of Active Directory username, using Principle Class. but I can not understand the differences between Principle.Name & Principle.SamAccountName?. As for all the current users the two properties are having exactly the same values

    Monday, July 15, 2013 7:44 AM

Answers

  • User1508394307 posted

    The samaccountname value comes from the authentication method at pre-Windows 2000 systems and the Principle.Name is a user principal name (UPN) associated with the user account at newest systems. Depends on domain and network configuration they could have same or different values (composed of the user logon name and the UPN suffix joined by the @ sign).

    Ex

    sAMAccountName: jdoe
    NetBIOS-Name: domain\jdoe
    userPrincialName: jdoe@domain.com

    Some applications can still use sAMAccountName, so that's probably why sAMAccountName is still there. So, if your AD has the same values you can use just one of the attributes.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 24, 2013 4:25 PM

All replies

  • User-166373564 posted

    Hi John

    the differences between Principle.Name & Principle.SamAccountName?.

    Principal.SamAccountName Property gets or sets the SAM account name for this principal,

    Principal.Name Property gets or sets the name of this principal.

    At the same time you can also learn a series of Principal properties here,

    Regards

    Monday, July 22, 2013 3:52 AM
  • User1508394307 posted

    The samaccountname value comes from the authentication method at pre-Windows 2000 systems and the Principle.Name is a user principal name (UPN) associated with the user account at newest systems. Depends on domain and network configuration they could have same or different values (composed of the user logon name and the UPN suffix joined by the @ sign).

    Ex

    sAMAccountName: jdoe
    NetBIOS-Name: domain\jdoe
    userPrincialName: jdoe@domain.com

    Some applications can still use sAMAccountName, so that's probably why sAMAccountName is still there. So, if your AD has the same values you can use just one of the attributes.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 24, 2013 4:25 PM