Skip to content

Revoke-MailboxPermission

SYNOPSIS

Revoke user(s) permission on a mailbox.

SYNTAX

Revoke-MailboxPermission [-Identity] <String> [-Permission] <String[]> [-User] <String[]> [-PassThru] [-WhatIf]
 [-Confirm] [<CommonParameters>]

DESCRIPTION

The `Revoke-MailboxPermission` function removes specified permissions (Full Access or Send As) for one or more users on a given mailbox. It supports both on-premises and Exchange Online environments and ensures proper validation of mailboxes and users before revoking permissions.

EXAMPLES

EXAMPLE 1

Revoke-MailboxPermission -Identity [email protected] -Permission FullAccess, SendAs -User 'John Doe' -PassThru

Revokes Full Access and Send As permissions for the user `John Doe` on the mailbox `info@domain.tld` and returns the affected mailbox object.

EXAMPLE 2

Revoke-MailboxPermission -Identity [email protected] -Permission FullAccess -User @('User1', 'User2')

Revokes Full Access permissions for `User1` and `User2` on the mailbox `shared@domain.tld`.

PARAMETERS

-Identity

The mailbox on which the permission needs to be removed. Can be a UserPrincipalName, DistinguishedName, or Alias.

Type: String
Parameter Sets: (All)
Aliases: DN, DistinguishedName, UserPrincipalName, UPN, sAMAccountName, Mailbox

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Permission

Specify which permission(s) need to be revoked. Valid options are `FullAccess` and `SendAs`.

Type: String[]
Parameter Sets: (All)
Aliases: Rights

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-User

An array of users whose permissions need to be revoked from the specified mailbox.

Type: String[]
Parameter Sets: (All)
Aliases: Member

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-PassThru

Returns the mailbox object that was affected.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES