dn_to_principal
Use the dn_to_principal command to specify the distinguished name (DN) of a security principal (user, computer, or group). The command searches Active Directory for the principal, and if the principal is found, the command returns the sAMAccount@domain name of the principal. Optionally, you can also use this command to return the user principal name (UPN) for the principal.
Zone Type
Not applicable
Syntax
dn_to_principal [-upn] principal_dn
Abbreviation
dntp
Options
This command takes the following option:
| Option | Description |
|---|---|
| -upn | Returns the principal name in user principal name (UPN) format, not the default sAMAccount@domain format. |
Arguments
This command takes the following argument:
| Argument | Type | Description |
|---|---|---|
| principal_dn | string | Required. Specifies the distinguished name (DN) of a security principal. |
Return Value
This command returns the sAMAccount@domain name or (optionally) the user principal name (UPN) of a security principal. If the command doesn’t find the specified security principal in Active Directory, it presents a message that it didn’t find the principal.
Examples
dn_to_principal cn=brenda butler,cn=users,dc=acme,dc=com
This example returns: brenda.butler@acme.com
Related Commands
The following commands search for security principals in Active Directory:
principal_to_dnsearches Active Directory for a user principal name (UPN) and, if found, returns the corresponding distinguished name (DN).principal_from_sidsearches Active Directory for an SID and returns the security principal associated with the SID.