Skip to main content

Set-ExMailboxMaxSize

SYNOPSIS

Set maximum mailbox size for specified mailboxes.

SYNTAX

Identity

Set-ExMailboxMaxSize -Identity <String[]> [-GenerateCmdlets] [-OutputFile <String>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

ByDomain

Set-ExMailboxMaxSize -ByDomain <String> [-GenerateCmdlets] [-OutputFile <String>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

FromCSV

Set-ExMailboxMaxSize -FromCSV <String> [-GenerateCmdlets] [-OutputFile <String>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

AllMailboxes

Set-ExMailboxMaxSize [-AllMailboxes] [-GenerateCmdlets] [-OutputFile <String>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

This function sets the maximum mailbox size (MaxReceiveSize and MaxSendSize) for Exchange Online mailboxes. It can target mailboxes by identity, by domain, from a CSV file, or all mailboxes in the organization.

EXAMPLES

EXAMPLE 1

Set-ExMailboxMaxSize -Identity "user@example.com" -MaxReceiveSize 150MB -MaxSendSize 150MB
Sets the maximum mailbox size for the specified mailbox.

EXAMPLE 2

Set-ExMailboxMaxSize -ByDomain "example.com"
Sets the maximum mailbox size for all mailboxes in the specified domain.

EXAMPLE 3

Set-ExMailboxMaxSize -AllMailboxes
Sets the maximum mailbox size for all mailboxes in the organization.

EXAMPLE 4

Set-ExMailboxMaxSize -FromCSV "C:\path\to\file.csv"
Sets the maximum mailbox size for mailboxes listed in the specified CSV file.

EXAMPLE 5

Set-ExMailboxMaxSize -ByDomain "example.com" -GenerateCmdlets -OutputFile "C:\path\to\commands.ps1"
Generates the Set-Mailbox cmdlets for all mailboxes in the specified domain and saves them to the specified file without executing them.

PARAMETERS

-Identity

The identity of the mailbox(es) to set the maximum size for. This can be an array of email addresses, usernames, or display names.

Type: String[]
Parameter Sets: Identity
Aliases:

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

-ByDomain

Filter mailboxes by domain name. All mailboxes with a primary SMTP address in this domain will be processed.

Type: String
Parameter Sets: ByDomain
Aliases:

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

-FromCSV

The path to a CSV file containing mailbox identities to process.

Type: String
Parameter Sets: FromCSV
Aliases:

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

-AllMailboxes

If specified, all mailboxes in the organization will be processed.

Type: SwitchParameter
Parameter Sets: AllMailboxes
Aliases:

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

-GenerateCmdlets

If specified, the function will generate the Set-Mailbox cmdlets and save them to a file instead of executing them.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-OutputFile

The path to the output file where generated cmdlets will be saved. Default is a timestamped file in the current directory.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: "$(Get-Date -Format 'yyyy-MM-dd_HHmmss')-SetExMailboxMaxSize-Commands.ps1"
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

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

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