2

I want to search a user with "Display Name". I come across FindByIdentity function and it can search with below IdentityTypes:

DistinguishedName 3 The identity is a Distinguished Name (DN).

Guid 5 The identity is a Globally Unique Identifier (GUID).

Name 1 The identity is a name.

SamAccountName 0 The identity is a Security Account Manager (SAM) name.

Sid 4 The identity is a Security Identifier (SID) in Security Descriptor Definition Language (SDDL) format.

UserPrincipalName 2 The identity is a User Principal Name (UPN).

(refer: https://learn.microsoft.com/en-us/dotnet/api/system.directoryservices.accountmanagement.identitytype?view=netframework-4.7.2)

May I have your advice what is "Name" here?

Mark
  • 283
  • 3
  • 22

1 Answers1

3

The Name field corresponds to the CN value (Common Name) for the object, which is unique within the domain.

Am_I_Helpful
  • 18,735
  • 7
  • 49
  • 73
  • Sorry may I ask is there any function to search an AD user with "Display Name"? – Mark Jan 10 '19 at 03:44
  • 1
    Hi @Mark. There is no direct defined method as such, but you can use LDAPSearchFilter for the attribute `displayName` like: (&(objectClass=user)(displayName=yourInputValue)). – Am_I_Helpful Jan 10 '19 at 07:41
  • 1
    Sure. Thanks. You_are_helpful. – Mark Jan 11 '19 at 09:30