Friday, January 04, 2013

Office 365 script for giving (or recinding) send-as permissions


param($mailboxname,$user)
$mailbox = get-mailbox $mailboxname
#Give user full mailbox rights
Add-MailboxPermission -Identity $mailbox -User $user -AccessRights 'FullAccess'
#Give user send-as rights to mailbox
Add-ADPermission -Identity $mailbox.DisplayName -User $user -ExtendedRights 'Send-as'
--------------
param($mailboxname,$user)

$mailbox = get-mailbox $mailboxname
#Remove user full mailbox rights
Remove-MailboxPermission -Identity $mailbox -User $user -AccessRights 'FullAccess'
#Remove user send-as rights to mailbox
Remove-ADPermission -Identity $mailbox.DistinguishedName -User $user -ExtendedRights 'Send-as'


Article source here
http://www.exchange-powershell.com/ 

No comments: