Powershell command/script to add multiple users for mailbox perrmission - can't use groups!

rated by 0 users
This post has 1 Reply | 1 Follower

Top 25 Contributor
Posts 123
JakeS Posted: 03-20-2012 9:12 AM

Hi,

Due to a bug in Exchange 2010 SP1 I can't use security groups to add full access for several people to someone's mailbox as the "auto-connect" feature doesn't work with security groups.  Does anyone have a way to just add a list of users that are in a csv or text file and give them full mailbox access to the specified mailbox?

Top 100 Contributor
Posts 34

Hi there

Do you mean something like:

example.txt
john doe
peter griffin
stan smith

And then give them fullaccess to a mailbox examplemailbox?

In that case, something like this might do the job:

1) Add them to a .txt file one above the other.
2) In the EMS...
Get-Content example.txt | foreach { Add-MailboxPermission examplemailbox -User $_ -AccessRights fullaccess}

 

Also you can create small scripts to make your life easier, and instead of making modifications to the script you will only need to type the information in the shell, for example...

$var1 = Read-Host "Type the file name" ### example.txt as an example
$var2 = Read-Host "Type the mailbox to give fullaccess to" ### e.g. examplemailbox
Get-Content $var1 | foreach { Add-MailboxPermission $var2 -User $_ -AccessRights fullaccess}

 

Hope that helps, cheers.

D.

Page 1 of 1 (2 items) | RSS
Copyright 2012 PowerShell.com. All rights reserved.