New! GraphQL.NET Cookbook by Senthil Kumar Balu

How to get the List of AD Groups that a user is member of using PowerShell?

Assume that you have a userid which is part of Active Directory and you would like to get the list of all the active directory groups in which the specified user is a member of. You can do this easily using Powershell.

How to get the List of AD Groups that a user is member of using PowerShell?

Here’s a Powershell code snippet demonstrating how to do it. Replace the <userName> with the username that you want find the groups for which the username is member of.

Import-Module ActiveDirectory
(Get-ADUser <userName> –Properties MemberOf | Select-Object MemberOf).MemberOf
Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.