Commands › Exchange Online

New-RemoteMailbox

Exchange Online ExchangeOnlineManagement New-*

Create a mail user in the on-premises Active Directory and also create an associated mailbox in the cloud-based service.

Quick start script

# New-RemoteMailbox — 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-RemoteMailbox
$before | Format-List

# 3. Make the change (dry run first)
New-RemoteMailbox -Name <String> -AccountDisabled <SwitchParameter> -Equipment <SwitchParameter> -WhatIf
New-RemoteMailbox -Name <String> -AccountDisabled <SwitchParameter> -Equipment <SwitchParameter>

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

Syntax — 5 parameter sets

Default

New-RemoteMailbox [-Name] <String> -Password <SecureString> -UserPrincipalName <String>
 [-ACLableSyncedObjectEnabled]
 [-Alias <String>]
 [-Archive]
 [-Confirm]
 [-DisplayName <String>]
 [-DomainController <Fqdn>]
 [-FirstName <String>]
 [-ImmutableId <String>]
 [-Initials <String>]
 [-LastName <String>]
 [-ModeratedBy <MultiValuedProperty>]
 [-ModerationEnabled <Boolean>]
 [-OnPremisesOrganizationalUnit <OrganizationalUnitIdParameter>]
 [-PrimarySmtpAddress <SmtpAddress>]
 [-RemotePowerShellEnabled <Boolean>]
 [-RemoteRoutingAddress <ProxyAddress>]
 [-ResetPasswordOnNextLogon <Boolean>]
 [-SamAccountName <String>]
 [-SendModerationNotifications <TransportModerationNotificationFlags>]
 [-WhatIf]
 [<CommonParameters>]

Room

New-RemoteMailbox [-Name] <String> [-Password <SecureString>] [-Room] [-UserPrincipalName <String>]
 [-ACLableSyncedObjectEnabled]
 [-Alias <String>]
 [-Archive]
 [-Confirm]
 [-DisplayName <String>]
 [-DomainController <Fqdn>]
 [-FirstName <String>]
 [-ImmutableId <String>]
 [-Initials <String>]
 [-LastName <String>]
 [-ModeratedBy <MultiValuedProperty>]
 [-ModerationEnabled <Boolean>]
 [-OnPremisesOrganizationalUnit <OrganizationalUnitIdParameter>]
 [-PrimarySmtpAddress <SmtpAddress>]
 [-RemotePowerShellEnabled <Boolean>]
 [-RemoteRoutingAddress <ProxyAddress>]
 [-ResetPasswordOnNextLogon <Boolean>]
 [-SamAccountName <String>]
 [-SendModerationNotifications <TransportModerationNotificationFlags>]
 [-WhatIf]
 [<CommonParameters>]

Equipment

New-RemoteMailbox [-Name] <String> [-Equipment] [-Password <SecureString>] [-UserPrincipalName <String>]
 [-ACLableSyncedObjectEnabled]
 [-Alias <String>]
 [-Archive]
 [-Confirm]
 [-DisplayName <String>]
 [-DomainController <Fqdn>]
 [-FirstName <String>]
 [-ImmutableId <String>]
 [-Initials <String>]
 [-LastName <String>]
 [-ModeratedBy <MultiValuedProperty>]
 [-ModerationEnabled <Boolean>]
 [-OnPremisesOrganizationalUnit <OrganizationalUnitIdParameter>]
 [-PrimarySmtpAddress <SmtpAddress>]
 [-RemotePowerShellEnabled <Boolean>]
 [-RemoteRoutingAddress <ProxyAddress>]
 [-ResetPasswordOnNextLogon <Boolean>]
 [-SamAccountName <String>]
 [-SendModerationNotifications <TransportModerationNotificationFlags>]
 [-WhatIf]
 [<CommonParameters>]

Shared

New-RemoteMailbox [-Name] <String> [-Shared] [-Password <SecureString>] [-UserPrincipalName <String>]
 [-ACLableSyncedObjectEnabled]
 [-Alias <String>]
 [-Archive]
 [-Confirm]
 [-DisplayName <String>]
 [-DomainController <Fqdn>]
 [-FirstName <String>]
 [-ImmutableId <String>]
 [-Initials <String>]
 [-LastName <String>]
 [-ModeratedBy <MultiValuedProperty>]
 [-ModerationEnabled <Boolean>]
 [-OnPremisesOrganizationalUnit <OrganizationalUnitIdParameter>]
 [-PrimarySmtpAddress <SmtpAddress>]
 [-RemotePowerShellEnabled <Boolean>]
 [-RemoteRoutingAddress <ProxyAddress>]
 [-ResetPasswordOnNextLogon <Boolean>]
 [-SamAccountName <String>]
 [-SendModerationNotifications <TransportModerationNotificationFlags>]
 [-WhatIf]
 [<CommonParameters>]

1 more parameter sets — see the parameter table below.

Parameters (27)

ParameterTypeRequiredWhat it controls
-Name String yes The Name parameter specifies the unique name of the on-premises mail user and the associated mailbox in the service. The maximum length is 64 characters. If the value contains spaces, enclose the value in quotation marks (").
-AccountDisabled SwitchParameter yes The AccountDisabled switch specifies whether to create the mail user in a disabled state. You don't need to specify a value with this switch.
-Equipment SwitchParameter yes The Equipment switch specifies that the mailbox in the service should be created as an equipment resource mailbox. You don't need to specify a value with this switch.
-Password SecureString The Password parameter specifies the password used by the mail user to secure his or her account and associated mailbox in the service.
-Room SwitchParameter yes The Room switch specifies that the mailbox in the service should be created as a room resource mailbox. You don't need to specify a value with this switch.
-Shared SwitchParameter yes **Note**: This switch is available only in Exchange 2013 CU21 or later and Exchange 2016 CU10 or later. To use this switch, you also need to run setup.exe /PrepareAD. For more information, see...
-UserPrincipalName String The UserPrincipalName parameter specifies the logon name for the user account. The UPN uses an email address format: `username@domain`. Typically, the domain value is the domain where the user account resides.
-ACLableSyncedObjectEnabled SwitchParameter The ACLableSyncedObjectEnabled switch specifies whether the remote mailbox is an ACLableSyncedMailboxUser. You don't need to specify a value with this switch.
-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...
-Archive SwitchParameter The Archive switch specifies whether to also create an archive mailbox in the service. You don't need to specify a value with this switch.
-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 and the associated mailbox in the service. The display name is visible in the Exchange admin center, in address lists, and in Outlook. The maximum...
-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...
-FirstName String The FirstName parameter specifies the user's first name.
-ImmutableId String The ImmutableId parameter is used by GAL synchronization (GALSync) and specifies a unique and immutable identifier in the form of an SMTP address for an Exchange mailbox used for federated delegation when requesting...
-Initials String The Initials parameter specifies the user's middle initials.
-LastName String The LastName parameter specifies the user's last name.
-ModeratedBy MultiValuedProperty The ModeratedBy parameter specifies one or more moderators for this recipient. A moderator approves messages sent to the recipient before the messages are delivered. A moderator must be a mailbox, mail user, or mail...
-ModerationEnabled Boolean The ModerationEnabled parameter specifies whether moderation is enabled for this recipient. Valid value are:
-OnPremisesOrganizationalUnit OrganizationalUnitIdParameter The OnPremisesOrganizationalUnit parameter specifies the organizational unit (OU) in the on-premises organization in which the new mailbox is added (for example, redmond.contoso.com/Users).
-PrimarySmtpAddress SmtpAddress The PrimarySmtpAddress parameter specifies the primary return email address that's used for the recipient.
-RemotePowerShellEnabled Boolean The RemotePowerShellEnabled parameter specifies whether the user has access to Exchange PowerShell. Valid values are:
-RemoteRoutingAddress ProxyAddress The RemoteRoutingAddress parameter specifies the SMTP address of the mailbox in the service that this user is associated with. This address is created automatically when the service is initially configured in the...
-ResetPasswordOnNextLogon Boolean The ResetPasswordOnNextLogon parameter specifies whether the user must change their password the next time they log on. Valid values are:
-SamAccountName String The SamAccountName parameter (also known as the pre-Windows 2000 user account or group name) specifies an object identifier that's compatible with older versions of Microsoft Windows client and server operating...
-SendModerationNotifications TransportModerationNotificationFlags The SendModerationNotifications parameter specifies when moderation notification messages are sent. Valid values are:
-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.