Commands › Exchange Online

Set-TextMessagingAccount

Exchange Online ExchangeOnlineManagement Set-*

The Set-TextMessagingAccount cmdlet allows a user to configure the text messaging settings on their own mailbox. An administrator can't use this cmdlet to configure the text messaging settings on another user's mailbox.

Quick start script

# Set-TextMessagingAccount — 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-TextMessagingAccount
$before | Format-List

# 3. Make the change (dry run first)
Set-TextMessagingAccount -Identity <MailboxIdParameter> -WhatIf
Set-TextMessagingAccount -Identity <MailboxIdParameter>

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

Syntax

Set-TextMessagingAccount [-Identity] <MailboxIdParameter>
 [-Confirm]
 [-CountryRegionId <RegionInfo>]
 [-DomainController <Fqdn>]
 [-IgnoreDefaultScope]
 [-MobileOperatorId <Int32>]
 [-NotificationPhoneNumber <E164Number>]
 [-WhatIf]
 [<CommonParameters>]

Parameters (8)

ParameterTypeRequiredWhat it controls
-Identity MailboxIdParameter yes The Identity parameter specifies the target mailbox. You can use any value that uniquely identifies the mailbox. For example:
-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.
-CountryRegionId RegionInfo The CountryRegionId parameter specifies the country/region that your mobile phone is registered in. Although this parameter accepts any valid ISO 3166-1 two-letter country code value (for example, AU for Australia),...
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-IgnoreDefaultScope SwitchParameter The IgnoreDefaultScope switch tells the command to ignore the default recipient scope setting for the Exchange PowerShell session, and to use the entire forest as the scope. You don't need to specify a value with this switch.
-MobileOperatorId Int32 The MobileOperatorId parameter specifies the mobile operator (carrier) for your phone. Although this parameter accepts any random number, the following values correspond to the country/region and mobile operator...
-NotificationPhoneNumber E164Number The NotificationPhoneNumber parameter specifies the telephone number to use for your text messaging notifications. This parameter uses the E.164 format: `+<CountryCode><CompleteTelephoneNumber>` (for example, `+15551234567`).
-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.