Scripts to grant FullAccess, SendAs, and SendOnBehalf Permissions

I have been getting requests to grant FullAccess (and other) permissions to a list of users to a Shared Mailbox, so I came up with some scripts.

This is FullAccess.ps1
import-csv .\people.csv | foreach {
$user = “ad\”+$_.people
Add-MailboxPermission -Identity “NAME OF RESOURCE” -User $user -AccessRights ‘FullAccess’
}

This is SendAs.ps1

import-csv .\people.csv | foreach {
$user = “ad\”+$_.people
Add-ADPermission “NAME OF RESOURCE” -User $user -Extendedrights “send as”
set-mailbox “NAME OF RESOURCE” -GrantSendOnBehalfTo $user
}

And my people.csv looks like this

people
USER1
USER2
USER3
USER4

Advertisements

About Mike

owner of blog
This entry was posted in PowerShell. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s