Commands › Exchange Online

Set-User

Exchange Online ExchangeOnlineManagement Set-*

Modify user attributes. You can use this cmdlet to modify all objects that have user accounts (for example, user mailboxes, mail users, and user accounts).

Quick start script

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

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

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

Syntax

Set-User [-Identity] <UserIdParameter>
 [-AllowUMCallsFromNonUsers <AllowUMCallsFromNonUsersFlags>]
 [-Arbitration]
 [-AssistantName <String>]
 [-AuthenticationPolicy <String>]
 [-BlockCloudCache <Boolean>]
 [-CanHaveCloudCache <Boolean>]
 [-CertificateSubject <MultiValuedProperty>]
 [-City <String>]
 [-ClearDataEncryptionPolicy]
 [-Company <String>]
 [-Confirm]
 [-CountryOrRegion <CountryInfo>]
 [-CreateDTMFMap <Boolean>]
 [-Department <String>]
 [-DesiredWorkloads <MailboxWorkloadFlags>]
 [-DisplayName <String>]
 [-DomainController <Fqdn>]
 [-EXOModuleEnabled <Boolean>]
 [-Fax <String>]
 [-FirstName <String>]
 [-Force]
 [-GeoCoordinates <GeoCoordinates>]
 [-HomePhone <String>]
 [-IgnoreDefaultScope]
 [-IsShadowMailbox <Boolean>]
 [-Initials <String>]
 [-LastName <String>]
 [-LinkedCredential <PSCredential>]
 [-LinkedDomainController <String>]
 [-LinkedMasterAccount <UserIdParameter>]
 [-MailboxRegion <String>]
 [-MailboxRegionSuffix <MailboxRegionSuffixValue>]
 [-ManagedOnboardingType <ManagedOnboardingType>]
 [-Manager <UserContactIdParameter>]
 [-MobilePhone <String>]
 [-Name <String>]
 [-Notes <String>]
 [-Office <String>]
 [-OtherFax <MultiValuedProperty>]
 [-OtherHomePhone <MultiValuedProperty>]
 [-OtherTelephone <MultiValuedProperty>]
 [-Pager <String>]
 [-PermanentlyClearPreviousMailboxInfo]
 [-Phone <String>]
 [-PhoneticDisplayName <String>]
 [-PostalCode <String>]
 [-PostOfficeBox <MultiValuedProperty>]
 [-PublicFolder]
 [-RemotePowerShellEnabled <Boolean>]
 [-RemoveMailboxProvisioningConstraint]
 [-ResetPasswordOnNextLogon <Boolean>]
 [-SamAccountName <String>]
 [-SeniorityIndex <Int32>]
 [-SimpleDisplayName <String>]
 [-SkipDualWrite]
 [-StateOrProvince <String>]
 [-StreetAddress <String>]
 [-StsRefreshTokensValidFrom <DateTime>]
 [-TelephoneAssistant <String>]
 [-Title <String>]
 [-UMCallingLineIds <MultiValuedProperty>]
 [-UMDtmfMap <MultiValuedProperty>]
 [-UserPrincipalName <String>]
 [-VIP <Boolean>]
 [-WebPage <String>]
 [-WhatIf]
 [-WindowsEmailAddress <SmtpAddress>]
 [<CommonParameters>]

Parameters (68)

ParameterTypeRequiredWhat it controls
-Identity UserIdParameter yes The Identity parameter specifies the user that you want to modify. You can use any value that uniquely identifies the user. For example:
-AllowUMCallsFromNonUsers AllowUMCallsFromNonUsersFlags This parameter is available only in on-premises Exchange.
-Arbitration SwitchParameter This parameter is available only in on-premises Exchange.
-AssistantName String The AssistantName parameter specifies the name of the user's assistant.
-AuthenticationPolicy String The AuthenticationPolicy parameter specifies the authentication policy to apply to the user. You can use any value that uniquely identifies the policy. For example:
-BlockCloudCache Boolean This parameter is available only in the cloud-based service.
-CanHaveCloudCache Boolean This parameter is available only in the cloud-based service.
-CertificateSubject MultiValuedProperty This parameter is available only in on-premises Exchange.
-City String The City parameter specifies the user's city.
-ClearDataEncryptionPolicy SwitchParameter This parameter is available only in the cloud-based service.
-Company String The Company parameter specifies the user's company.
-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.
-CountryOrRegion CountryInfo The CountryOrRegion parameter specifies the user's country or region. A valid value is a valid ISO 3166-1 two-letter country code (for example, AU for Australia) or the corresponding friendly name for the country...
-CreateDTMFMap Boolean This parameter is available only in on-premises Exchange.
-Department String The Department parameter specifies the user's department.
-DesiredWorkloads MailboxWorkloadFlags This parameter is available only in the cloud-based service.
-DisplayName String The DisplayName parameter specifies the display name of the user. The display name is visible in the Exchange admin center and in Active Directory. The maximum length is 256 characters. If the value contains spaces,...
-DomainController Fqdn This parameter is available only in on-premises Exchange.
-EXOModuleEnabled Boolean This parameter is available only in the cloud-based service.
-Fax String The Fax parameter specifies the user's fax number.
-FirstName String The FirstName parameter specifies the user's first name.
-Force SwitchParameter This parameter is available only in the cloud-based service.
-GeoCoordinates GeoCoordinates The GeoCoordinates parameter specifies the user's location in latitude, longitude and (optionally) altitude coordinates. A valid value for this parameter uses one of the following formats:
-HomePhone String The HomePhone parameter specifies the user's home telephone number.
-IgnoreDefaultScope SwitchParameter This parameter is available only in on-premises Exchange.
-Initials String The Initials parameter specifies the user's middle initials.
-IsShadowMailbox Boolean This parameter is available only in the cloud-based service.
-LastName String The LastName parameter specifies the user's last name.
-LinkedCredential PSCredential This parameter is available only in on-premises Exchange.
-LinkedDomainController String This parameter is available only in on-premises Exchange.
-LinkedMasterAccount UserIdParameter This parameter is available only in on-premises Exchange.
-MailboxRegion String This parameter is available only in the cloud-based service.
-MailboxRegionSuffix MailboxRegionSuffixValue This parameter is available only in the cloud-based service.
-ManagedOnboardingType ManagedOnboardingType This parameter is available only in the cloud-based service.
-Manager UserContactIdParameter The Manager parameter specifies the user's manager.
-MobilePhone String The MobilePhone parameter specifies the user's primary mobile phone number.
-Name String The Name parameter specifies the unique name of the user. The maximum length is 64 characters. If the value contains spaces, enclose the value in quotation marks (").
-Notes String The Notes parameters specifies additional information about the object. If the value contains spaces, enclose the value in quotation marks (").
-Office String The Office parameter specifies the user's physical office name or number.
-OtherFax MultiValuedProperty The OtherFax parameter specifies the user's alternative fax number.
-OtherHomePhone MultiValuedProperty The OtherHomePhone parameter specifies the user's alternative home telephone number.
-OtherTelephone MultiValuedProperty The OtherTelephone parameter specifies the user's alternative telephone number.
-Pager String The Pager parameter specifies the user's pager number.
-PermanentlyClearPreviousMailboxInfo SwitchParameter This parameter is functional only in the cloud-based service.
-Phone String The Phone parameter specifies the user's office telephone number.
-PhoneticDisplayName String The PhoneticDisplayName parameter specifies an alternate spelling of the user's name that's used for text to speech in Unified Messaging (UM) environments. Typically, you use this parameter when the pronunciation and...
-PostalCode String The PostalCode parameter specifies the user's zip code or postal code.
-PostOfficeBox MultiValuedProperty The PostOfficeBox parameter specifies the user's post office box number.
-PublicFolder SwitchParameter The PublicFolder switch is required to modify public folder mailboxes. You don't need to specify a value with this switch.
-RemotePowerShellEnabled Boolean **Note**: In cloud-based environments, this parameter will be deprecated. We recommend using the EXOModuleEnabled parameter instead.
-RemoveMailboxProvisioningConstraint SwitchParameter This parameter is available only in the cloud-based service.
-ResetPasswordOnNextLogon Boolean The ResetPasswordOnNextLogon parameter specifies whether the user must change their password the next time they log on. Valid values are:
-SamAccountName String This parameter is available only in on-premises Exchange.
-SeniorityIndex Int32 The SeniorityIndex parameter specifies the order in which this user is displayed in a hierarchical address book. A user with a value of 2 is displayed higher in an address book than a user with a value of 1.
-SimpleDisplayName String The SimpleDisplayName parameter is used to display an alternative description of the object when only a limited set of characters is permitted. Valid characters are:
-SkipDualWrite SwitchParameter This parameter is available only in on-premises Exchange.
-StateOrProvince String The StateOrProvince parameter specifies the user's state or province.
-StreetAddress String The StreetAddress parameter specifies the user's physical address.
-StsRefreshTokensValidFrom DateTime This parameter is available only in the cloud-based service.
-TelephoneAssistant String This parameter is available only in on-premises Exchange.
-Title String The Title parameter specifies the user's title.
-UMCallingLineIds MultiValuedProperty This parameter is available only in on-premises Exchange.
-UMDtmfMap MultiValuedProperty This parameter is available only in on-premises Exchange.
-UserPrincipalName String This parameter is available only in on-premises Exchange.
-VIP Boolean This parameter is available only in the cloud-based service.
-WebPage String The WebPage parameter specifies the user's Web page.
-WhatIf SwitchParameter This parameter is reserved for internal Microsoft use.
-WindowsEmailAddress SmtpAddress The WindowsEmailAddress parameter specifies the Windows email address for this recipient. This is a common Active Directory attribute that's present in all environments, including environments without Exchange. Using...

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