Commands › Microsoft Teams

Set-CsUser

Microsoft Teams MicrosoftTeams Set-*

Modifies Skype for Business properties for an existing user account.

Quick start script

# Set-CsUser — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

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

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

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

Syntax

Set-CsUser [-DomainController <Fqdn>] [-Identity] <UserIdParameter> [-PassThru] [-WhatIf] [-Confirm]
 [-OnPremLineURI <String>] [-LineServerURI <String>] [-AudioVideoDisabled <Boolean>]
 [-RemoteCallControlTelephonyEnabled <Boolean>] [-PrivateLine <String>] [-AcpInfo <AcpInfo>]
 [-HostedVoiceMail <Boolean>] [-EnterpriseVoiceEnabled <Boolean>]
 [-ExchangeArchivingPolicy <ExchangeArchivingPolicyOptionsEnum>] [-LineURI <String>] [-SipAddress <String>]
 [-Enabled <Boolean>] [<CommonParameters>]

Parameters (17)

ParameterTypeRequiredWhat it controls
-AcpInfo AcpInfo Enables you to assign one or more third-party audio conferencing providers to a user. However, it is recommended that you use the `Set-CsUserAcp` cmdlet to assign Audio conferencing providers.
-AudioVideoDisabled Boolean Indicates whether the user is allowed to make audio/visual (A/V) calls by using Skype for Business. If set to True, the user will largely be restricted to sending and receiving instant messages.
-Confirm SwitchParameter Prompts you for confirmation before executing the command.
-DomainController Fqdn Enables you to specify a domain controller to connect to when modifying a user account. If this parameter is not included then the cmdlet will use the first available domain controller.
-Enabled Boolean Indicates whether or not the user has been enabled for Skype for Business Server. If you set this value to False, the user will no longer be able to log on to Skype for Business Server; setting this value to True...
-EnterpriseVoiceEnabled Boolean Indicates whether the user has been enabled for Enterprise Voice, which is the Microsoft implementation of Voice over Internet Protocol (VoIP). With Enterprise Voice, users can make telephone calls using the Internet...
-ExchangeArchivingPolicy ExchangeArchivingPolicyOptionsEnum Indicates where the user's instant messaging sessions are archived. Allowed values are:
-HostedVoiceMail Boolean When set to True, enables a user's voice mail calls to be routed to a hosted version of Microsoft Exchange Server. In addition, setting this option to True enables Skype for Business users to directly place a call to...
-Identity UserIdParameter yes Indicates the Identity of the user account to be modified. User Identities can be specified using one of four formats: 1) the user's SIP address; 2) the user's user principal name (UPN); 3) the user's domain name and...
-LineServerURI String The URI of the remote call control telephone gateway assigned to the user. The LineServerUri is the gateway URI, prefaced by "sip:". For example: sip:rccgateway@litwareinc.com
-LineURI String Phone number to be assigned to the user in Skype for Business Server or Direct Routing phone number to be assigned to a Microsoft Teams user in GCC High and DoD cloud instances only.
-OnPremLineURI String Specifies the phone number assigned to the user if no number is assigned to that user in the Skype for Business hybrid environment. The line Uniform Resource Identifier (URI) must be specified using the E.164 format...
-PassThru SwitchParameter Enables you to pass a user object through the pipeline that represents the user whose account is being modified. By default, the `Set-CsUser` cmdlet does not pass objects through the pipeline.
-PrivateLine String Phone number for the user's private telephone line. A private line is a phone number that is not published in Active Directory Domain Services and, as a result, is not readily available to other people. In addition,...
-RemoteCallControlTelephonyEnabled Boolean Indicates whether the user has been enabled for remote call control telephony. When enabled for remote call control, a user can employ Skype for Business to answer phone calls made to his or her desk phone. Phone...
-SipAddress String Unique identifier (similar to an email address) that allows the user to communicate using SIP devices such as Skype for Business. The SIP address must use the sip: prefix as well as a valid SIP domain; for example:...
-WhatIf SwitchParameter Describes what would happen if you executed the command without actually executing the command.

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