Set-CsPhoneNumberAssignment will assign a phone number to a user or a resource account (online application instance). When you assign a phone number the EnterpriseVoiceEnabled flag is automatically set to True.
These cmdlets support assigning and removing phone numbers from Microsoft Calling Plan, Direct Routing and Operator Connect
This cmdlet is available in Teams Powershell module 3.0.0 or later. If this command is executed on Powershell version lower than 3.0.0, one will encounter below PS error.
Set-CsPhoneNumberAssignment : The term 'Set-CsPhoneNumberAssignment' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
Below is a powershell help output for this cmdlet
Organisation needs to prepare to use Set-csPhonenumberassignment once below commands will be deprecated and will no longer be available to assign phone number.
Set-CsUser
Set-CsOnlineVoiceUser
Set-CsOnlineApplicationInstance
Set-CsOnlineVoiceApplicationInstance
Note:
If a user or resource account has a phone number set in Active Directory on-premises and synched into Microsoft 365, you can't use Set-CsPhoneNumberAssignment to set the phone number. You will have to clear the phone number from the on-premises Active Directory and let that change sync into Microsoft 365 first.
The previous command for assigning phone numbers to users Set-CsUser had the parameter HostedVoiceMail. Setting HostedVoiceMail for Microsoft Teams users is no longer necessary and that is why the parameter is not available on Set-CsPhoneNumberAssignment.
References:
Comments