daknetworks.com

You are here: Blog Find All Distribution Groups A User Is A Member Of

Find All Distribution Groups A User Is A Member Of

Find All Distribution Groups A User Is A Member Of. I hope that makes sense. Let's say you have a user name: foo.user. What groups is foo.user a member of?

Here's how:

Get-DistributionGroup -Filter "Members -like 'CN=foo user,OU=where-ever,OU=Users,DC=domain-name-here,DC=tld'"

Since the DistinguishedName is used, it makes it nearly impossible to use the command unless you keep it in a handy note somewhere. Instead, this may be easier:

-type: $distinguishedName =  (Get-Mailbox -Identity foo.user).distinguishedname
-type: $group = Get-DistributionGroup -Filter "Members -like '$($distinguishedName)'"
-type: Write-Host $group

Contact Dak Networks

Please contact us at the following.