• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 86
  • Last Modified:

Exchange 2010 Management Shell

This is the senerio. I have users with full manage access to shared mailboxes, but we have been involved in a mailbox migration from 1 org to another and as a result the mailbox permissions have been broken. I have an
excel .csv file with all the mailboxes that each user has permissions to. This is in the hundreds of mailboxes and users have access to multiple mailboxes. In the Excel csv file I have the name of the mailboxes and the users that has access to them. Is there a way that a script can be run in EMS against the .csv so that it will assign those users back to the mailbox. This is the script I generally run when there is 1 .csv with multiple users accessing the same mailbox I generally export all the users in a csv into a variable and them manually specify the name of the mailbox identity:

$userList = Import-Csv .\excel\name.csv
foreach ($user In $userList) {
Add-MailboxPermission -Identity “mailbox name” -User $user.Name -AccessRights FullAccess–InheritanceType All
}

So now, I have 1 .csv but in this csv there are multiple users and multiple mailboxes, and I would like to know how to run a similar script or cmdlet against the info in the csv so that those users can be reassigned the mailboxes they are next to in the csv file. Any assistance will be greatly appreciated.

example.xlsx
0
timgreen7077
Asked:
timgreen7077
1 Solution
 
QlemoC++ DeveloperCommented:
Let's assume the mailbox name column in the CSV  is Mailbox, as the username is Name. Then all you have to change in your script is to replace "mailbox name" with $user.Mailbox.
According to the attached CSV, it is different:
foreach ($user In Import-Csv .\excel\name.csv) {
  Add-MailboxPermission -Identity $user.Identity -User $user.User -AccessRights FullAccess–InheritanceType All
}

Open in new window

0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now