The PowerShell command to get adgroupmember domain admins users from the Active Directory is
Get-AdGroupMembers along with the
Identity parameter “Domain Admins”.
Here is the PowerShell command to get members of the domain admins group.
Get-AdGroupMember -Identity "DomainAdmins"
In this article, we will discuss how to get adgroupmember domain admins users using PowerShell.
How to Get Members of the Domain Admins Group
To get members of the
domain admins group, use the Get-AdGroupMember command with the Identity parameter to specify the group name.
Get-ADGroupMember -Identity "Domain Admins" | Select-Object -Property Name, SamAccountName, DisplayName
In the above PowerShell script, the
Get-AdGroupMember command returns a list of all the users who are members of the Domain Admins group and uses the
Select-Object cmdlet to select SamAccountName and DisplayName.
The output of the above PowerShell script to get adgroup members of specified Domain Admins group is:
Cool Tip: How to get adgroupmember name and email address in PowerShell!
I hope the above article on how to use the
Get-AdGroupMember cmdlet in PowerShell to get members of the domain admins group is helpful to you.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.