Retrieving the display name of Active Directory (AD) users is a common administrative task for IT teams. It is what most users and applications see, rather than technical identifiers like sAMAccountName or DistinguishedName (DN), and is widely used in corporate address books, email clients, audit reports, and identity management systems. When managing user accounts in larger organizations, the ability to quickly look up or export display names reduces errors and saves time. Although PowerShell offers a dependable method, GUI-based tools like ManageEngine ADManager Plus make things easier by providing bulk management features, export options, and built-in reports.
Below is a comparison of how to get an AD user's display name using Windows PowerShell and ManageEngine ADManager Plus.
Prerequisites
Open Windows PowerShell and import the Active Directory module:
Import-Module ActiveDirectory
Getting an AD user's display name
To get the display name of a known user, specify the user's identity (e.g., sAMAccountName, UserPrincipalName, or DistinguishedName) and explicitly request the DisplayName property. Replace "username" with the actual user logon name:
Get-ADUser -Identity "username" -Properties DisplayName | Select-Object DisplayName
Want to edit display names? See how ADManager Plus can help modify AD user attributes.
This returns the display name property of the user with the SAM account name "jdoe".
Get-ADUser -Identity "jdoe" -Properties DisplayName | Select-Object DisplayName
Lists every user in AD with both their logon name and display name.
Get-ADUser -Filter * -Properties DisplayName | Select-Object Name, DisplayName
Exports the name and display name of all users to a CSV file.
Get-ADUser -Filter * -Properties DisplayName | Select-Object Name, DisplayName | Export-Csv -Path "C:\AllUserDisplayNames.csv" -NoTypeInformation
This helps find users if you only know part of their display name.
Get-ADUser -Filter "DisplayName -like '*John*'" -Properties DisplayName | Select-Object SamAccountName, DisplayName
This searches for users whose display name exactly matches "John Doe".
Get-ADUser -Filter {DisplayName -eq "John Doe"} -Properties SamAccountName | Select-Object SamAccountName, DisplayName
This imports a CSV file containing display names of users and outputs properties like sAMAccountName and email address.
$users = Import-Csv -Path "C:\Path\To\UsersByDisplayName.csv"
foreach ($user in $users) {
$adUser = Get-ADUser -Filter {DisplayName -eq $user.DisplayName} -Properties SamAccountName, DisplayName, EmailAddress, Title
if ($adUser) {
# If multiple users with same display name, return all
foreach ($u in $adUser) {
Write-Output "DisplayName: $($u.DisplayName), SamAccountName: $($u.SamAccountName), Email: $($u.EmailAddress), Title: $($u.Title)"
}
} else {
Write-Output "User with DisplayName '$($user.DisplayName)' not found."
}
}
The following parameters are useful for retrieving user display names with PowerShell:
| Parameter | Description |
|---|---|
| -Identity | Specifies the user to query (SAM account name, DN, GUID, or SID) |
| -Filter | Enables filtering by DisplayName or other attributes |
| -Properties | Requests additional properties (like DisplayName) in results |
| -SearchBase | Limits the search to a specific OU or container |
| -Server | Specifies the domain controller to query |
| -Credential | Runs with alternate credentials |
| -AuthType | Selects authentication methods like Negotiate and Basic. |
While powerful, relying solely on PowerShell for extensive user reporting can present challenges:
ADManager Plus bridges the gap between powerful AD reporting and ease of use. Here's why it's a better choice for many IT teams:
Run the following command to search for display names and include unique identifiers like SamAccountName or DistinguishedName:
Get-ADUser -Filter {DisplayName -eq "John Smith"} -Properties SamAccountName, DistinguishedName |
Select-Object DisplayName, SamAccountName, DistinguishedName
Run this command to fetch display names with group memberships:
Get-ADUser -Filter * -Properties DisplayName |
Select-Object DisplayName, @{Name="Groups";Expression={(Get-ADPrincipalGroupMembership $_ | Select-Object -ExpandProperty Name) -join ","}}
Alternatively, ADManager Plus offers pre-built reports to help you list AD group memberships with users' display names.
ADManager Plus offers features to help you update AD user attributes in bulk, like display names, logon names, and more. This prevents the hassle of repetitive actions and scripting errors.
To bulk update using PowerShell, first prepare a CSV file (e.g., C:\DisplayNames.csv) with SamAccountName and DisplayName columns. Then run:
Import-Csv "C:\DisplayNames.csv" | ForEach-Object {
Set-ADUser -Identity $_.SamAccountName -DisplayName $_.DisplayName
}
Run the following script to find a user’s logon name using their display name:
Get-ADUser -Filter {DisplayName -eq "John Doe"} -Properties SamAccountName | Select-Object SamAccountName, DisplayName