Quantcast
Channel: Microsoft Office 365
Viewing all articles
Browse latest Browse all 17713

Use PowerShell to list a mailbox's group membership in Exchange Online

$
0
0

I was writing a PowerShell driven application and needed a way to list out a user's group membership as part of it, and discovered that there is no native way to do this at this time. I knew I could write something that would poll the membership of all groups using Get-DistributionGroup and Get-DistributionGroupMember, but with over 500 groups in the tenancy I'm working with, that would take far too long to process. Unfortunately, looking online for an alternative, that's the only method I saw others discussing, so I decided to try and solve the problem myself.

I discovered that the cmdlet Get-Group returns a property called "Members" with the list of accounts that are members of that group. I couldn't find a way to get the built-in -Filterparameter to do what I was looking for, but calling Get-Group directly and passing it to...


Viewing all articles
Browse latest Browse all 17713

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>