Management

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 785 other subscribers

Social

  • LinkedIn
  • RSS Feed for Posts
  • Twitter
  • StumbleUpon

Bulk give Full Access and SendAs rights

First create Full-Access-SendAS.csv :

Column1,Column2
Richard,Ronald
Ronald,Fred

This scripts gives the user Ronald Full Access and SendAs rights on the mailbox of user Richard, and the user Fred, Full Access and SendAs rights on the mailbox of user Ronald.

The option “-AutoMapping $false” prevents auto creation of the Richards mailbox in outlook of Ronald.

$List = Import-Csv C\Scripts\Full-Access-SendAS.csv
foreach ($Line in $List)
{
$UserMailbox = $Line.column1
$AccessUser = $Line.column2

Write-Verbose $UserMailbox
write-Verbose $AccessUser

function GiveFullAccess
{
Param ($UserMailbox2, $AccessUser2)
write-Verbose $UserMailbox2
write-Verbose $AccessUser2
Add-MailboxPermission -Identity $UserMailbox2 -User $AccessUser2 -AccessRights FullAccess -InheritanceType All -AutoMapping $false
}

GiveFullAccess $UserMailbox $AccessUser
Write-Host -backgroundcolor green -ForegroundColor black “User “$AccessUser” now has full access on mailbox “$UserMailbox” !”

function GiveSendAs
{
param ($UserMailbox2, $AccessUser2)
write-Verbose $UserMailbox2
write-Verbose $AccessUser2
Add-RecipientPermission $UserMailbox2 -AccessRights SendAs -Trustee $AccessUser2 -Confirm:$False
}

GiveSendAs $UserMailbox $AccessUser
Write-Host -backgroundcolor green -ForegroundColor black “User “$AccessUser” now has SendAs rights on mailbox “$UserMailbox” !”

}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.