Error: Set-CsPhoneNumberAssignment — Update failed for user
This is more for my memory than anything else, but maybe it’ll help someone else out if they encounter this issue. I enabled 300 people for Direct Routing today and for 3 of these users I encountered an error:
PS C:\Users\xxxxxxxx> Set-CsPhoneNumberAssignment -Identity 'xxxxx-xxxxxx.xxxxxxxx@xxxxxxxxx.com' -PhoneNumberType DirectRouting -PhoneNumber '+1xxxxxxxxxx;ext=xxxxx'
Microsoft.Teams.ConfigAPI.Cmdlets.internal\Set-CsPhoneNumberAssignment : Update failed for user 'addf37f8-a677-4e0f-xxxx-xxxxxxxxxxxx'. Please try again
At C:\Users\xxxxxxxx\OneDrive Corp\OneDrive - xxxxxxxxxxxxx\Documents\WindowsPowerShell\Modules\MicrosoftTeams\4.9.1\custom\Merged_custom_PsExt.ps1:1298 char:13
+ Microsoft.Teams.ConfigAPI.Cmdlets.internal\Set-CsPhoneNum ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: ({ Identity = Ma...iceEnabled = }:<>f__AnonymousType101`5) [Set-CsPhoneNumberAssignment_Set], Exception
+ FullyQualifiedErrorId : BadRequest,Microsoft.Teams.ConfigAPI.Cmdlets.Generated.Cmdlets.SetCsPhoneNumberAssignment_Set
I also tried from the Teams Admin Center, and the number assignment failed there also.
Weirdly, the fix was to use the same Set-CsPhoneNumberAssignment cmdlet but set -EnterpriseVoiceEnabled to $false, before waiting a few seconds (this is important, don’t try too quickly) and trying the original command again.
These users have never been EV enabled before, so not sure why that happens, but this fix has worked every time I’ve had it so far.
PS C:\Users\xxxxxxxx> Set-CsPhoneNumberAssignment -Identity 'xxxxx-xxxxxx.xxxxxxxx@xxxxxxxxx.com' -EnterpriseVoiceEnabled:$false
PS C:\Users\xxxxxxxx> Set-CsPhoneNumberAssignment -Identity 'xxxxx-xxxxxx.xxxxxxxx@xxxxxxxxx.com' -PhoneNumberType DirectRouting -PhoneNumber '+1xxxxxxxxxx;ext=xxxxx'
Cheers!