The Microsoft Exchange certificate is installed when you install an Exchange Server, and it's 5…
Export mailbox folder permissions to CSV file
In a previous article, we discussed how to export mailbox permissions to CSV file. This time we want to export mailbox folder permissions to CSV file. We like to know which user has access to which folder and which permission level they have access to that folder. We will look into the mailbox folder permissions of a single user and all the users. In this article, you will learn how to export mailbox folder permissions to CSV file.
Introduction
To let you understand what permissions are being exported, it’s better to have an example. Start Outlook and sign in as a user. In our case, it’s the user James.
Outlook Today (Top of Information Store) folder permissions
Right-click on the email address in the left sidebar and select Folder Permissions. That is the Outlook Today (Top of Information Store).
We can see that the permission level Publishing Author is given to the user Anna.
Inbox folder permissions
Right-click the Inbox folder and click Properties.
Click the Permissions tab. The permission level Reviewer is given to the user Boris.
Management subfolder permissions
Right-click the Inbox folder and create a new folder. Name the subfolder Management. Right-click the created subfolder and click Properties.
Click on the Permissions tab. You can see that it’s inheriting the permissions from the parent folder. That’s because we created the subfolder after we configured the permissions. In our case, it’s the Inbox folder.
Add another user to the Management folder and give the permission level Contributor. In our example, Hannah is given the permissions level Contributor.
Sales subfolder permissions
Create one more subfolder. We are creating a subfolder with the name Sales. We don’t want to give permissions to that subfolder.
Note that the subfolder permissions are inherited from the parent folder if you create a new subfolder. The subfolder will look at the permissions of the parent folder. If you add permissions to the parent folder after you created the subfolder, the permissions of the subfolder will not be inherited.
Right-click the Sales folder and click Properties.
Go to the Permissions tab. Remove the user Boris from permissions and click Apply. The names Default and Anonymous with permission level None is the default. Keep it like that.
We configured the following permissions on the folders:
Outlook Today (Top of Information Store) – Publishing Author – Anna
Inbox – Reviewer – Boris
Management – Reviewer – Boris
Management – Contributor – Hannah
Sales – Default
In the next step, we are going to look into the mailbox folder permissions PowerShell script.
Export mailbox folder permissions PowerShell script
Download the Get-MailboxPermissionsReport.ps1 PowerShell script made by Thomas Stensitzki. Save the file in C:\scripts\. If you don’t have a scripts folder, create one.
The Get-MailboxPermissionsReport.ps1 PowerShell script does have the following options for exporting the permissions:
- Option 1: Export mailbox folder permissions of a single user
- Option 2: Export mailbox folder permissions of users that start or end with a given name
- Option 3: Export mailbox folder permissions of the entire organization
Let’s have a look at the options in the next step.
Option 1: Export mailbox folder permissions of a single user
Run Exchange Management Shell as administrator. Change the directory to the scripts folder.
[PS] C:>cd \scripts
Get specific mailbox folder permissions of a user. Fill in the display name or email address of the user mailbox. The exported CSV file will be in the same place as the script with the name MailboxPermissions_Single_User.csv.
[PS] C:\scripts>.\Get-MailboxPermissionsReport.ps1 -MailboxId "James.Paterson@exoip.com" -CsvFileName "MailboxPermissions_Single_User.csv"
After running the above cmdlet, go to the scripts folder. Open the CSV file with the application Notepad.
Open the CSV file with your favorite CSV file editor. For example, Microsoft Excel. What you can see is that you don’t see the Sales folder in the list. That’s because the folder does not have any permissions configured.
If there are no permissions configured on the folders, the folders will not be exported to the CSV file.
Option 2: Export mailbox folder permissions of users that start or end with a given name
This will look at the mailboxes starting with the name James. If you want to search mailboxes that end with a name, change the * to the front of the name. It will look like “*James” instead of “James*”. The CSV file will export in the same place where the script was started with the name MailboxPermissions_Multi_User.csv.
[PS] C:\scripts>.\Get-MailboxPermissionsReport.ps1 -MailboxId "James*" -CsvFileName "MailboxPermissions_Multi_User.csv"
In the next step, we will get every user mailbox folder permissions in the organization and export it to a CSV file. It can take time if you have a large organization.
Option 3: Export mailbox folder permissions of the entire organization
Get all the mailbox folder permissions in the Exchange organization. This will export the mailbox folder permissions of all the user mailboxes in the Exchange organization to the file MailboxPermissions_All_Users.csv.
[PS] C:\scripts>.\Get-MailboxPermissionsReport.ps1 -CsvFileName "MailboxPermissions_All_Users.csv"
Open the CSV file. We can see the mailbox folder permissions of all the user mailboxes in the organization.
Did this help you to get the mailbox folder permissions in Exchange Server and export it to a CSV file?
Keep on reading: Create Active Directory Users from CSV with PowerShell »
Conclusion
In this article, you learned how to export mailbox folder permissions to CSV file. Make use of the Get-MailboxPermissionsReport.ps1 PowerShell script. Run the script to generate a CSV file with the mailbox permissions. Go to the location and open the CSV file with your favorite CSV file editor. Have a look at which mailbox folder permissions are configured.
Did you enjoy this article? You may also like Add email address to list of names in Excel. Don’t forget to follow us and share this article.
Hi Ali,
I am getting this error below when running the script to export permission for a user
PS C:\git> .\Get-MailboxPermissionsReport.ps1 -MailboxId Sch-Nur-Laptop&Proj1-old@contoso.com -CsvFileName Sch-Nur-Laptop&Proj1.CSV
At line:1 char:71
+ … boxPermissionsReport.ps1 -MailboxId Sch-Nur-Laptop&Proj1-ol …
+ ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks (“&”) to pass it as part of a string.
At line:1 char:122
+ … ur-Laptop&Proj1-old@unisa.edu.au -CsvFileName Sch-Nur-Laptop&Proj1.CS …
+ ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks (“&”) to pass it as part of a string.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : AmpersandNotAllowed
Any comment / suggestion
Hi Hakim,
I redacted sensitive information from the output in your comment.
The ampersand (&) character is not allowed. You have to wrap the values with double quotation marks. The correct command will look like this: