Grant-MailboxPermission
SYNOPSIS
Grant user(s) permission on a mailbox.
SYNTAX
Grant-MailboxPermission [-Identity] <String> [-Permission] <String[]> [-User] <String[]> [-NoAutoMapping]
[-Force] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
The `Grant-MailboxPermission` function grants specified permissions (Full Access and/or Send As) to one or more users on a mailbox. It supports options for disabling auto-mapping, forcing permissions on personal mailboxes, and returning the affected mailbox object.
EXAMPLES
EXAMPLE 1
Grant-MailboxPermission -Identity "[email protected]" -Permission FullAccess, SendAs -User "John Doe" -NoAutoMapping -Force -PassThru
Grants Full Access and Send As permissions to `John Doe` on the mailbox `info@domain.tld` without auto-mapping and returns the affected mailbox object.
PARAMETERS
-Identity
The mailbox on which the permission needs to be set (e.g., DistinguishedName, UserPrincipalName, or SamAccountName).
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 granted. Valid values are `FullAccess` and/or `SendAs`.
Type: String[]
Parameter Sets: (All)
Aliases: Rights
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-User
The user(s) who need to be granted the specified permission(s).
Type: String[]
Parameter Sets: (All)
Aliases: Member
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-NoAutoMapping
A switch to prevent auto-mapping of the mailbox for the user(s).
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-Force
A switch to allow permissions to be set on a personal user mailbox instead of a shared mailbox.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-PassThru
A switch to return the mailbox object that was affected.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
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.