PS command to list sahred mailbox + distro list membership for specific user

%3CLINGO-SUB%20id%3D%22lingo-sub-2169472%22%20slang%3D%22en-US%22%3EPS%20command%20to%20list%20sahred%20mailbox%20%2B%20distro%20list%20membership%20for%20specific%20user%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2169472%22%20slang%3D%22en-US%22%3E%3CP%3EI%E2%80%99m%20looking%20a%20for%20a%20powershell%20command%20I%20can%20run%20to%20get%20a%20list%20of%20all%20the%20distro%20groups%20and%20shared%20mailboxes%20a%20specific%20user%20is%20a%20member%20of%2C%20but%20I%20cannot%20seem%20to%20find%20one%20that%20would%20do%20that.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20know%20I%20can%20run%20a%20command%20on%20a%20specific%20shared%20mailbox%20to%20get%20a%20list%20of%20members%20but%20when%20I%20have%20to%20setup%20a%20new%20user%20and%20give%20him%2Fher%20the%20same%20access%20as%20someone%20else%20it%20would%20be%20more%20efficient%20to%20run%20a%20command%20that%20can%20show%20me%20what%20User%20A's%20memberships%20are%20so%20I%20can%20give%20them%20to%20User%20B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2169472%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

I’m looking a for a powershell command I can run to get a list of all the distro groups and shared mailboxes a specific user is a member of, but I cannot seem to find one that would do that.

 

I know I can run a command on a specific shared mailbox to get a list of members but when I have to setup a new user and give him/her the same access as someone else it would be more efficient to run a command that can show me what User A's memberships are so I can give them to User B

1 Reply
Not sure where exactly you looked, but there are tons of examples on how to do it available online. For Full access, check here: https://www.michev.info/Blog/Post/1516/quickly-list-all-mailboxes-to-which-a-particular-user-has-acc...
For group membership, this is the most efficient way:

Get-Recipient -Filter "Members -eq 'CN=user,OU=domain.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=EURPR03A001,DC=prod,DC=outlook,DC=com'"

where you have to specify the DistinguishedName for the user.