Removing many Exchange full access permissions on a mailbox

5,573

Can you just do this? I removed the "Select User" since that is for display purposes only and used no parameters on "Remove-MailboxPermision" since it accepts input. Haven't tested though.

Get-MailboxPermission -Identity $TheUser | where {($_.User -notlike
"NT AUTHORITY\SELF") -and ($_.User -notlike "DOMAIN\svcEnterpriseVault")} | 
Remove-MailboxPermission
Share:
5,573

Related videos on Youtube

chris
Author by

chris

Updated on September 18, 2022

Comments

  • chris
    chris over 1 year

    I'm trying to use Powershell to remove certain full access permissions on an account as part of a disable user process.

    I need to remove all full access permissions on the account except for:

    NT AUTHORITY\SELF and DOMAIN\svcEnterpriseVault

    How can I go about doing this using the Remove-MailboxPermission cmdlet?

    Thanks

    Edit: I've gotten a little further with the command below, but I am having trouble passing the list of full-access users to the Remove-MailboxPermission cmdlet.

    Get-MailboxPermission -Identity $TheUser | Select User | where {($_.User -notlike
     "NT AUTHORITY\SELF") -and ($_.User -notlike "DOMAIN\svcEnterpriseVault")} | Remove-MailboxPermission -Identity $TheUser -User [ALL THE USERS FROM THE GET-MAILBOX COMMAND]