SOLVED

Unable to assign a Teams Phone number to a brand new user account (Error: we can't save changes)

Iron Contributor

Hi folks, 

 

I'm facing an issue where I can't assign a Teams phone number (Canadian number issued by Microsoft) to a newly provisioned user via UI or PowerShell. The user was provisioned couple of days ago and the licenses/user location was perfectly set (as we normally do for every other request). 

 

Licenses - M365 E5, M365 Domestic and International calling plan.

User Location - Canada 

 

Error from the UI (attached screenshot) - "We can't save changes for the number right now. Try again later"

PowerShell Errors

Output from the old command: (Set-CsOnlineVoiceUser -Identity Email address removed -TelephoneNumber +16*********

Set-CsOnlineVoiceUser : Cmblet invocation error

 

Output from the latest command: ( Set-CsPhoneNumberAssignment -Identity Email address removed -PhoneNumber 16*********)

Bad Request The User '*********' is not found

 

Here's what I've tried so far but none has worked:
1. Disable and re-enable the account 
2. Remove any numbers associated in the profile (there was a one under the mobile but that shouldn’t make any sense. Removed it anyways but no luck). No numbers allocated in the on-prem AD profile.
3. Remove and re-assign all licenses
4. Obtain a brand new number and try to assign that

 

Any insights would be really helpful. Thank you!

 

Screenshot 2022-01-25 095410.jpgScreenshot 2022-01-25 095537.jpg

6 Replies
Update ---

I also tried the following alternatives but none was effective. The issue remained intact

Try to get rid of the stale entries in the Phone number field using the command below:
Set-CsPhoneNumberAssignment -Identity "upngoeshere" -PhoneNumber ""

Then try to assign again
Set-CsPhoneNumberAssignment -Identity "upngoeshere" -PhoneNumber "+16*********"

Disabled and enabled hostedvoicemail and enterprisevoice features for the user with no luck either

set-csuser -identity "upngoeshere" -hostedvoicemail $false -enterprisevoiceenabled $false
set-csuser -identity "upngoeshere" -hostedvoicemail $true -enterprisevoiceenabled $true
best response confirmed by Manoj Karunarathne (Iron Contributor)
Solution
Update ----------

Apparently this had to be escalated to Microsoft support and then to the engineering team internally. After 2-3 days, the number got assigned from the backend. The rootcause is still unknown and I am waiting to hear back.

Hope this will help someone out there one day.

@Manoj Karunarathne and anyone else interested - I had a very similar situation.  This with the most recent updates to the MicrosoftTeams PS Module.

 

Let me start with this:  We use Direct Routing

 

I have an existing user who simply moved to another geo-location and wanted her Teams phone number to reflect the local area.  Easy, right?  remove one and add a different one? Usually very simple.  

 

What I tried to assign was a number vacated by a terminated employee, but Teams PowerShell kept telling me the "number is already assigned to another user", yet if I filtered users in the Teams admin center by phone number, it was NOT in use by anyone else, and PowerShell kept telling me "invalid user account" 

 

What I ended up doing was not necessarily a good solution, but it did work.  I had to re-enable the terminated employee's AD account and allow it to sync. THEN I was able to remove the LineURI from the terminated user account, and assign it to its new owner.  

 

This has never been the case until now/latest Teams PS Module.  I frequently re-issue phone numbers from termed employees to new hires without any trouble at all.  I don't think enabling a terminated user's AD account is a very secure way to get things done...hopefully this gets fixed. 

 

Hope this helps anyone else having weird issues with Teams PS lately.

@Manoj Karunarathne I have a similar issue and even Microsoft Support were struggling with this one.

 

I think I’ve fixed it! Found a bigger hammer…though perhaps “older” is a better description.

After the Admin portal wasn’t working, I went back to PowerShell to delve deeper to gain some insights as to what might be going on.

 

First, I tried Set-CsPhoneNumberAssignment and the same “Bad Request, user not found”.

Then I decided to look at differences between working users and the one that does not work.

 

2 things jumped out.

 

Working:

OptionFlag                           : 131456

SipAddress                           : em***@*******.com.au 

SipProxyAddress                  : em***@******.com.au 

 

Not Working:

OptionFlag                           : 196864

SipAddress                           : al***@******.com.au 

SipProxyAddress                  : 1821529039******bfe68a0b190******cal***@******.com.au 

 

Using the Exchange Admin tool, I removed Al****’s SIP address, then added it again. This normalised the SIP address so both the SipAddress & SipProcyAddress matched.

 

It still did not work. I checked other users and they all had the same OptionFlag as Em*** (Working). I was stumped, but kept digging.

I stumbled across Adam Fowler’s post about the old PowerShell commands being deprecated and will be removed in April this year.
https://www.adamfowlerit.com/tag/microsoft-teams/

 

This gave me an idea…would the old commands work? Maybe they do things a little differently?

I gave it a go. Didn’t work to start with as I needed to find the correct Location Id….Get-CsOnlineLisLocation to the rescue.

 

Now with all the bits I needed, I ran Set-CsOnlineVoiceUser….

 

IT WORKED! No error. Quick check with Get-CsOnlineUser and yes the number is assigned. Checked the Teams Admin and it all looks like it stuck! Rang user, left a Voice Message on the new number. They just called back. =)

 

Leaving this here incase it helps someone else.

Although Manoj discovered his root cause here, and Andy also posted additional experiences and insights, want to raise to the Community's attention that the Teams Phone Advanced Deployment Guide provides thorough coverage of three different techniques to assign phone numbers to users.

KentMitchell_0-1655936812839.png

 

 

In addition to covering this topic, the Teams Phone Advanced Deployment Guide provides a detailed checklist of all Steps required to deploy Teams Phone to your organization.

 

Please note that the Teams Phone Advanced Deployment Guide is located in the M365 Admin Center, so you will need to login with a Tenant Admin account to view this deployment guide.

I want to add one more thing... I worked with Microsoft Support when I ran into this problem. They stated that I should be careful that when I create a resource account and assign it a phone number, I should wait about 24 hours to allow this to propagate through some backend systems before attempting to add the resource account to an auto attendant (for example).
I found this to be true when I remove a phone number from a user, too... I have to wait a while before I can reassign that phone number to another user. At least, this was true for phone numbers that are set as Voice App types and while I moved the phone number around between resource accounts.
I am just saying, a bit of patience may be necessary.
1 best response

Accepted Solutions
best response confirmed by Manoj Karunarathne (Iron Contributor)
Solution
Update ----------

Apparently this had to be escalated to Microsoft support and then to the engineering team internally. After 2-3 days, the number got assigned from the backend. The rootcause is still unknown and I am waiting to hear back.

Hope this will help someone out there one day.

View solution in original post