In my previous post I showed how to retrieve the membership of one or multiple groups. In today's post I want to find the Distribution groups a user belongs to.
There are multiple approaches you could be using to gather this information but as an example I'll re-use the same one-liner from my previous article and simply filter with Where-Object to find a particular User.
This is probably the route PowerShell beginners would take and it is working 'Fine' in a small environment but not very efficient, you'll see in the following example.
In this environment, there are a bit more than 1800 Distribution Groups. I want to know which Distribution Group I'm member of.
![]() |
Retrieving the count of Distribution Groups and an User account in Office 365 |