Home ยป PowerShell ยป PowerShell Get AD Group Members DisplayName

PowerShell Get AD Group Members DisplayName

PowerShell Get-ADGroupMember gets an active directory group members, members can be users, groups, or computers. To get ad group members displayname, we need to use the PowerShell Get-ADUser cmdlet.

In this article, we will discuss how to get ad group members displayname from the active directory in PowerShell.

The Get-ADGroupMember only gets active directory group members, to get ad group members properties, we need to use other active directory cmdlets in PowerShell.

For example,

Use the PowerShell Get-AdUser cmdlet, to get active directory user properties.

Use the PowerShell Get-ADGroup cmdlet, to get active directory group properties.

Use the PowerShell Get-ADComputer cmdlet, to get active directory computer properties.

Get AD Group Member DisplayName for User

Using PowerShell Get-ADGroupMember and Get-AdUser cmdlet to get ad group member displayname for the user, run the below command

Get-ADGroupMember -identity Administrators -Recursive | Get-ADUser -Property DisplayName | Select Name, DisplayName

In the above PowerShell command, the Get-ADGroupMember cmdlet gets all the members of the โ€œAdministratorsโ€ active directory group and nested group using Recursive parameter. It then passes the output of ad group members to the second command.

The second command uses the PowerShell Get-ADUser cmdlet to get DisplayName properties for user objects and pass output to the third command.

The third command, select Name and DisplayName of user and list displayname of users on console and if required export ad user to a csv file.

Conclusion

PowerShell Get-ADGroupMember cmdlet gets ad group members and uses Get-ADUser cmdlet to get ad group members displayname in PowerShell.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.