Remove/Add Rights to Shared O365 Mailbox

Full access rights

Add-MailboxPermission -Identity shared@domain.com -User user@domain.com -AccessRights FullAccess -InheritanceType All
Remove-MailboxPermission -Identity shared@domain.com -User user@domain.com -AccessRights FullAccess -IneritanceType All

Send As

Add-RecipientPermission -Identity shared@domain.com -AccessRights SendAs -Trustee user@domain.com
Remove-MailboxPermission -Identity shared@domain.com -AcccessRights SendAs -Trustee user@domain.com

Send on Behalf


Set-Mailbox -Identity shared@domain.com -GrantSendOnBehalfTo @{remove="user@domain.com"}
Set-Mailbox -Identity shared@domain.com -GrantSendOnBehalfTo @{add="user@domain.com"}

Function to add all permissions for User to Shared Mailbox

function addperms ($sharedmb, $user)
{
Add-MailboxPermission -Identity $sharedmb -User $user -AccessRights FullAccess -InheritanceType All
Add-RecipientPermission -Identity $sharedmb -AccessRights SendAs -Trustee $user
Set-Mailbox -Identity $sharedmb -GrantSendOnBehalfTo @{add="$user"}}

Function to remove all permissions for User to Shared Mailbox

function remperms ($sharedmb, $user)
{
Remove-MailboxPermission -Identity $sharedmb -User $user -AccessRights FullAccess -InheritanceType All
Remove-RecipientPermission -Identity $sharedmb -AccessRights SendAs -Trustee $user
Set-Mailbox -Identity $sharedmb -GrantSendOnBehalfTo @{remove="$user"}}

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s