Microsoft Exchange
Although email is rapidly moving aware from on premise Microsoft Exchange servers and into the cloud, there are still a hell of a lot of business still using older versions of Exchange. In this scenerio, a project manager has asked to be supplied with all Exchange shared mailboxes and who has what permissions to each one. To carry this out, we can use the Exchange Management Shell (EMS) to input a basic script which will output this information to CSV which then in turn can be passed on to the project manager.EMS Script
Enter the below script into EMS and this will export the results into a .csv file:Get-Mailbox -RecipientTypeDetails SharedMailbox | Get-MailboxPermission | Select Identity,User,@{Name='Access Rights';Expression={[string]::join(', ', $_.AccessRights)}} | Export-Csv C:\sharedmailboxpermission.csv -NoTypeInformation
Update (September 2026): the one-liner above was previously sitting in a plain blockquote, which meant WordPress was converting the straight quotes into curly smart quotes when the page rendered, so copying and pasting it straight from the site would break in PowerShell. It’s now in a code block, which is not affected by that, and the missing hyphen on -NoTypeInformation has also been fixed, it was showing as a colon.
where:
- C:\sharedmailboxpermission.csv = CSV save location and file name (don’t actually save to the root of your C: drive – that is stupid and usually throws a permissions error!)
Exchange Online Equivalent
If your shared mailboxes live in Exchange Online rather than on premise Exchange, connect with Connect-ExchangeOnline first, then use the Get-EXOMailbox and Get-EXOMailboxPermission cmdlets instead:
Get-EXOMailbox -RecipientTypeDetails SharedMailbox | Get-EXOMailboxPermission | Select Identity,User,@{Name='Access Rights';Expression={[string]::join(', ', $_.AccessRights)}} | Export-Csv C:\sharedmailboxpermission.csv -NoTypeInformation
These are the REST based cmdlets from the Exchange Online PowerShell module and return the same Identity, User and AccessRights properties as the on premise cmdlets, so the rest of the script above works unchanged.
What more can make my life easier?
Well, we have a number of Powershell scripts available our PowerShell script collection which might help you out. Otherwise, just that a browse around our site and see what you can find. In the top right is a search function too.Feedback
If you have any questions or feedback on this guide, please feel free to leave us a message below in our comments section and we will try and get back to you as soon as we can.Gear We Recommend
A few general tech accessories worth having alongside this.
Browse our General Tech Accessories picks on AmazonAs an Amazon Associate, TechyGeeksHome earns from qualifying purchases.
Discover more from TechyGeeksHome
Subscribe to get the latest posts sent to your email.