Tuesday, 25 August 2015

Remove Full Access Permission using Powershell

We can use the Remove-MailboxPermission cmdlet to remove full access permission from a user's mailbox. To perform this task, your account need to be added in the server roles Organization Management and Recipient Management.

Run the below command to load Exchange cmdlets to use the Remove-MailboxPermission cmdlet.
Add-PSSnapin *Exchange*
The following example removes user Morgan's full access rights from Kevin's mailbox.
Remove-MailboxPermission -Identity "Kevin" -User "Morgan" -AccessRights FullAccess -InheritanceType All
Identity - The name of the user on which the full access permission to be removed.
User - The mailbox that has the full access permission.

Remove Full Access Permission for Bulk Users from Text file:

Use the below powershell script to remove full access permissions for bulk exchange mailbox users from text file. First create the text file Mailboxes.txt which includes one mailbox in each line.
Get-Content C:\Mailboxes.txt | ForEach-Object{
 $mailbox = $_
 Remove-MailboxPermission -Identity $mailbox -User "Admin" -AccessRights FullAccess -InheritanceType All         -Confirm:$Y -WhatIf
}

Remove Full Access Permission for multiple mailbox users:

Use the below powershell command to remove full access permission for multiple exchange mailbox users.
$mailboxes = "TestUser1","TestUser2"
$mailboxes  | ForEach-Object{
 $mailbox = $_
 Remove-MailboxPermission -Identity $mailbox -User "Admin" -AccessRights FullAccess -InheritanceType All         -Confirm:$Y -WhatIf
}

Advertisements
Advertisements

No comments:

Post a Comment