Granting Permissions on Mailboxes using Power shell

Published on
11,552 Points
1 Endorsement
Last Modified:
If you have some accounts which needs to have full access permission on hundreds of mailboxes then following power shell command is for you. By using following steps you can add set of users to hundreds of mailboxes in single shot.

In order to use this command you have to perform below steps;

1. Create one csv file name it users.csv and save it to C:\ drive.

2. Type text "name" in first line. Please make sure that there is no space or any other special character after text "name" otherwise the command will not run.

3. Copy all user ids (of mailboxes) on which you want to add permissions after text "name" in same column.

4. Open Exchange Management Shell and type following command and press enter;

Import-CSV "C:\users.csv" | ForEach{Add-MailboxPermission –ID $_.name –AccessRights FullAccess –User [Account id]}

Replace [Account id] with the account id which you want to grant full access permissions on mailboxes.

for verifying that the permissions has been granted, Run following command;

Import-CSV "C:\users.csv" | ForEach{Get-MailboxPermission –ID $_.name –User [Account id}

You can add more columns in you text file if you want by using comma ‘,’ and can reference it in the command as same as you are referencing the first column.

If you don’t have aliases or Ids and have only display names and these display names are in last name first name format such as smith, john then you have to add your names in your .csv file like this “smith, john”

if you want to do opposite and wants to add full access permission for lots users on one mailbox then following will be your command

Import-Csv c:\users.csv | foreach {Add-MailboxPermission –Identity [Account Id] -User $_.users -Accessright Fullaccess -InheritanceType all}

Replace [Account Id] with the mailbox alias or name.

The above command is one of the demonstration of the "power" of powershell and we can see that how much it has reduced the administration efforts in terms of mailbox management.

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Join & Write a Comment

This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month