Commands › Exchange Online

Enable-MailUser

Exchange Online ExchangeOnlineManagement Enable-*

Mail-enable existing users that aren't already mail-enabled.

Quick start script

# Enable-MailUser — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-MailUser
$before | Format-List

# 3. Make the change (dry run first)
Enable-MailUser -Identity <UserIdParameter> -ExternalEmailAddress <ProxyAddress> -WhatIf
Enable-MailUser -Identity <UserIdParameter> -ExternalEmailAddress <ProxyAddress>

# 4. Verify and diff
$after = Get-MailUser
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax — 2 parameter sets

EnabledUser (Default)

Enable-MailUser [-Identity] <UserIdParameter> -ExternalEmailAddress <ProxyAddress>
 [-Alias <String>]
 [-Confirm]
 [-DisplayName <String>]
 [-DomainController <Fqdn>]
 [-MacAttachmentFormat <MacAttachmentFormat>]
 [-MessageBodyFormat <MessageBodyFormat>]
 [-MessageFormat <MessageFormat>]
 [-PrimarySmtpAddress <SmtpAddress>]
 [-UsePreferMessageFormat <Boolean>]
 [-WhatIf]
 [<CommonParameters>]

EnableGuestUser

Enable-MailUser [-Identity] <UserIdParameter>
 [-ExternalEmailAddress <ProxyAddress>]
 [-Alias <String>]
 [-Confirm]
 [-DisplayName <String>]
 [-DomainController <Fqdn>]
 [-PrimarySmtpAddress <SmtpAddress>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (12)

ParameterTypeRequiredWhat it controls
-Identity UserIdParameter yes The Identity parameter specifies the user that you want to mail-enable. You can use any value that uniquely identifies the user. For example:
-ExternalEmailAddress ProxyAddress yes The ExternalEmailAddress parameter specifies an email address outside the organization. Email messages sent to the mail-enabled user are sent to this external address.
-Alias String The Alias parameter specifies the Exchange alias (also known as the mail nickname) for the recipient. This value identifies the recipient as a mail-enabled object, and shouldn't be confused with multiple email...
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-DisplayName String The DisplayName parameter specifies the display name of the mail user. The display name is visible in the Exchange admin center and in address lists. The maximum length is 256 characters. If the value contains...
-DomainController Fqdn The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name...
-MacAttachmentFormat MacAttachmentFormat The MacAttachmentFormat parameter specifies the Apple Macintosh operating system attachment format to use for messages sent to the mail contact or mail user. Valid values are:
-MessageBodyFormat MessageBodyFormat The MessageBodyFormat parameter specifies the message body format for messages sent to the mail contact or mail user. Valid values are:
-MessageFormat MessageFormat The MessageFormat parameter specifies the message format for messages sent to the mail contact or mail user. Valid values are:
-PrimarySmtpAddress SmtpAddress The PrimarySmtpAddress parameter specifies the primary return email address that's used for the recipient.
-UsePreferMessageFormat Boolean The UsePreferMessageFormat specifies whether the message format settings configured for the mail user or mail contact override the global settings configured for the remote domain or configured by the message sender....
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.