<

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Granting Permissions on Mailboxes using Power shell

Published on
11,669 Points
5,569 Views
1 Endorsement
Last Modified:
Approved
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.
1
Comment
0 Comments

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Join & Write a Comment

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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month