Hi Everyone this is Prem, I have worked as Microsoft 365 support ambassador. In this blog I will share How to Fix his cmdlet has been deprecated. Use the new Set-CsPhoneNumberAssignment and Remove-CsPhoneNumberAssignment cmdlets instead Error.
This error occurs when we run the PowerShell command Set-CsUser after connecting the PowerShell to the Teams admin center.
The command Set-CsUser has been deprecated as you can see from the error, and we have to use the Set-CsPhoneNumberAssignment instead going forward.
This new command has to be used in the senario of assigning a phone number to a user, or to a resource account used in call queue or auto attendant.
The above command can also be used to change EnterpriseVoiceEnabled parameter status as well of an user account.
Below are the examples of the parameter that can be set using the command:
Assign a phone number to a user:
Set-CsPhoneNumberAssignment -Identity ABC@contoso.com -PhoneNumber +1xxxxxxxxx0 -PhoneNumberType CallingPlan
The above command assign a phone number and Microsoft calling plan to the user.
Set the parameter of EnterpriseVoiceEnabled of an user account:
Set-CsPhoneNumberAssignment -Identity ABC@contoso.com -EnterpriseVoiceEnabled $true
More information of the new command can be found on the Official Microsoft Article
If you have any question please drop it in the comment box below.
Date:03/05/2023
Author: Prem
Tag: This cmdlet has been deprecated. Use the new Set-CsPhoneNumberAssignment and Remove-CsPhoneNumberAssignment cmdlets instead