Jan 24 2022 03:28 PM
Jan 24 2022 03:28 PM
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"
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!
Jan 29 2022 10:46 PM
Jan 29 2022 10:49 PMSolution
Feb 07 2022 07:11 AM
@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.
Feb 21 2022 07:25 PM
@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.
OptionFlag : 131456
SipAddress : em***@*******.com.au
SipProxyAddress : em***@******.com.au
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.
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.