Getting Members of an Active Directory Group

Over the last few weeks, I’ve found myself wanting to know which users are members of a particular Active Directory (AD) group.

There are lots of reasons you might want to do this, but for me, the main one is that I sometimes need to know who has access to an application or resource (which is controlled by that group’s membership list). With that, I can let them know about outages, find out if other users are experiencing a problem with it or just be nosey ūüôā

In Powershell, this is really easy.

One way is like this, using the Get-ADGroupMember command:

This will return results similar to the following:

Another way is using the net group command:

which returns results in a more columnar fashion:

Need the results saved¬†into a text file? That’s no problem, either. Just append the following onto the end of the command:

That line¬†(|)¬†in the example above is the pipe symbol. On my keyboard, I find it next to the “z” key and access it by pressing shift. Just for clarity, here’s the Get-ADGroupMember¬†command again using it.

So, now you know!

twittergoogle_plusredditpinteresttumblrmail

Written by Stephen Moon
email: stephen at logicalmoon.com
www: https://www.logicalmoon.com


Leave a Reply

Your email address will not be published. Required fields are marked *