How To Get PowerShell Ad Group Membership Details
How to get the PowerShell ad group membership details for a user? Are there more than one ways to get the adgroup membership in PowerShell?
How to get the PowerShell ad group membership details for a user? Are there more than one ways to get the adgroup membership in PowerShell?
To get the ad group membership for a user, try this simple command to execute in Power Shell:
$strUserName = "Name Of User"
$strUser = get-qaduser –Any Acc Name
$strUser Name $strUser.memberof
You can also get ad group membership details by executing another command, i.e.,
Get-AD Principal Group Membership:
Get-AD Principal Group Membership Any User Name | select any name
For name
—
Workstation Admins
Domain Computers
Automated Processing Team
There are other commands as well but they are quite complicated and difficult to understand.