How To PowerShell Tips & Tricks

Building a script to find all members of a given group

Some time ago, I was asked to provide a list of everyone with access to a specific system. After communicating with the client, it transpired that they were particularly interested in knowing who were the members of a set of Active Directory groups. While this can be done manually, I wanted to try my hand at building a PowerShell-script that returned the information the client was asking for, and which I could reuse at some later point, as such requests pop up with some regularity.

code examples How To PowerShell

Exporting a list of a given users group memberships from Active Directory

A while back, I showed you how to export a list of all members of a group, as well as all computers, from Active Directory. On a related note, here’s how to export all group memberships held by a single user: