Full-Mailbox Permission Script: Exchange 2010
If you need a quick script to add the “FullAccess” permission for an account on behalf of another Exchange 2010 mailbox, here is your script:#Save this file as Add-Full-Mailbox-Permission.ps1 #Add-Full-Mailbox-Permission.ps1 $user=Read-Host “Enter a user name” $mailbox=Read-Host “Enter a mailbox you want to add the user to” Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 Set-ADServerSettings -ViewEntireForest:$True Set-ADServerSettings -PreferredServer MyDomainConroller.vlab.com Remove-MailboxPermission $mailbox -Accessrights “FullAccess” -User $user | FL # I added this to remove the account first, just in case the ACL is hosed in some way. Add-MailboxPermission $mailbox -Accessrights “FullAccess” -User $user | FL #End of Script
Now we can make it easier by creating a batch script that we can use to invoke the Exchange command at will.##Save this file as Call-Add-Full-Mailbox-Permission.bat Powershell.exe -noexit c:\scripts\Add-Full-Mailbox-Permission.ps1
Once you have both files created, you can now click on the batch file and use the script at your leisure. This is much easier than trying to remember syntax…..
Best of Luck!