Assert-MailboxPermissionGroup
SYNOPSIS
Ensure the existence of a mailbox permission group in Active Directory.
SYNTAX
Assert-MailboxPermissionGroup [-Identity] <String> [-Permission] <String> [-NoCreate] [<CommonParameters>]
DESCRIPTION
The `Assert-MailboxPermissionGroup` function ensures the existence of a mailbox permission group in Active Directory for a specified mailbox. It creates the group if it does not already exist and assigns the appropriate permissions (FullAccess or SendAs) to the group. The function can also return the group without creating it if the `-NoCreate` switch is specified.
EXAMPLES
EXAMPLE 1
Assert-MailboxPermissionGroup -Identity "[email protected]" -Permission FullAccess
Ensures the existence of a FullAccess permission group for the mailbox `user@example.com`.
EXAMPLE 2
Assert-MailboxPermissionGroup -Identity "[email protected]" -Permission SendAs -NoCreate
Checks for the existence of a SendAs permission group for the mailbox `user@example.com` without creating it.
PARAMETERS
-Identity
The identity of the mailbox (e.g., DistinguishedName, UserPrincipalName, or sAMAccountName) for which the permission group will be ensured.
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
The type of permission to assign to the group. Valid values are `FullAccess` or `SendAs`.
Type: String
Parameter Sets: (All)
Aliases: Rights
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-NoCreate
A switch to indicate that the function should not create the group if it does not already exist.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
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.