Skip to main content

Mailbox helpers

Requires an EXO session. For full and always-up-to-date details, use Get-Help <FunctionName> -Detailed.

Add-MboxAlias / Remove-MboxAlias

Add or remove SMTP aliases on a recipient.

Syntax

Add-MboxAlias -SourceMailbox <String> -MailboxAlias <String>
Remove-MboxAlias -SourceMailbox <String> -MailboxAlias <String>
ParameterDescriptionRequired
SourceMailbox (Identity)Target mailbox/recipient. Pipeline accepted.Yes
MailboxAliasAlias (SMTP address) to add/remove.Yes

Examples

Add-MboxAlias -SourceMailbox 'info@contoso.com' -MailboxAlias 'alias@contoso.com'
Add-MboxAlias -Identity 'user@contoso.com' -Aliases 'user.sales@contoso.com','user.eu@contoso.com'
Remove-MboxAlias -SourceMailbox 'info@contoso.com' -MailboxAlias 'alias@contoso.com'

Add/Remove/Get/Export-MboxPermission

Manage mailbox permissions and export them to CSV.

Syntax

Add-MboxPermission -Identity <String> -User <String> -AccessRights <String[]> [-AutoMapping]
Remove-MboxPermission -Identity <String> -User <String> -AccessRights <String[]>
Get-MboxPermission -Identity <String>
Export-MboxPermission -Identity <String> [-CsvFolder <String>]
ParameterDescriptionRequired (Add/Remove)
IdentityTarget mailbox.Yes
UserPrincipal to grant/revoke.Yes
AccessRightsRights (e.g., FullAccess, SendAs, SendOnBehalf).Yes (Add)
AutoMappingEnable/disable Outlook automapping.No
CsvFolder (Export)Destination folder for CSV export.No

Examples

Add-MboxPermission -Identity 'shared@contoso.com' -User 'john@contoso.com' -AccessRights FullAccess -AutoMapping:$false
Remove-MboxPermission -Identity 'shared@contoso.com' -User 'john@contoso.com' -AccessRights FullAccess
Export-MboxPermission -Identity 'shared@contoso.com' -CsvFolder 'C:\Temp'
Get-MboxPermission -Identity 'shared@contoso.com'

Get/Export-MboxAlias

List or export aliases for auditing.

Syntax

Get-MboxAlias -Identity <String>
Export-MboxAlias -Identity <String> [-CsvFolder <String>]
ParameterDescriptionRequired
IdentityTarget mailbox/recipient.Yes
CsvFolder (Export)Destination folder for CSV export.No

Examples

Get-MboxAlias -Identity 'user@contoso.com'
Export-MboxAlias -Identity 'user@contoso.com' -CsvFolder 'C:\Temp'

Set-MboxLanguage

Set mailbox UI language, time zone, and regional settings.

Syntax

Set-MboxLanguage -UserPrincipalName <String> [-Language <String>] [-TimeZone <String>]
[-DateFormat <String>] [-TimeFormat <String>]
ParameterDescription
UserPrincipalName (Identity)Target mailbox.
LanguageCulture code (e.g., it-IT, en-US).
TimeZoneTime zone ID (e.g., W. Europe Standard Time).
DateFormat / TimeFormatOptional overrides.

Example

Set-MboxLanguage -UserPrincipalName 'user@contoso.com' -Language it-IT -TimeZone "W. Europe Standard Time"

Set-MboxRulesQuota

Adjust inbox rules quota for a mailbox.

Syntax

Set-MboxRulesQuota -Identity <String> -RulesQuotaInKB <Int>
ParameterDescription
IdentityTarget mailbox.
RulesQuotaInKBNew quota in KB.

Example

Set-MboxRulesQuota -Identity 'user@contoso.com' -RulesQuotaInKB 128

New-SharedMailbox

Create a shared mailbox.

Syntax

New-SharedMailbox -Name <String> -Alias <String> -PrimarySmtpAddress <String> [-Members <String[]>]
[-Language <String>] [-TimeZone <String>]
ParameterDescriptionRequired
NameDisplay name.Yes
AliasMail alias.Yes
PrimarySmtpAddressPrimary SMTP.Yes
MembersMembers to grant FullAccess/SendAs.No
Language / TimeZoneOptional localization.No

Example

New-SharedMailbox -Name "Support" -Alias 'support' -PrimarySmtpAddress 'support@contoso.com' -Members 'agent1@contoso.com','agent2@contoso.com'

Set-SharedMboxCopyForSent

Toggle saving sent items for delegated send-as/send-on-behalf.

Syntax

Set-SharedMboxCopyForSent -Identity <String> [-Enable]
ParameterDescriptionRequired
IdentityShared mailbox.Yes
EnableSwitch to enable; omit for disable.No

Example

Set-SharedMboxCopyForSent -Identity 'shared@contoso.com' -Enable

Test-SharedMailboxCompliance

Quick checks on shared mailbox configuration (permissions, quotas, sent-items copy).

Syntax

Test-SharedMailboxCompliance -Identity <String>
ParameterDescription
IdentityShared mailbox to validate.

Example

Test-SharedMailboxCompliance -Identity 'shared@contoso.com'

Get-UserLastSeen

Return the most recent activity for a mailbox combining Exchange LastUserActionTime and (when available) Entra ID sign-in logs.

Syntax

Get-UserLastSeen -User <String>
ParameterDescription
User (Identity, UserPrincipalName)Target mailbox identity. Pipeline accepted.

Example

Get-UserLastSeen -User 'alice@contoso.com'

Notes:

  • Requires Exchange Online connection. Graph sign-in logs are included when AuditLog.Read.All + Directory.Read.All scopes are available.
  • Output includes LastUserActionTime, LastInteractiveSignIn, LastSeen, and the Source used.