Troubleshoot Microsoft Teams
Fix common PowerShell errors and calls that don't reach Microsoft Teams with direct routing.
Find your symptom or error message below. Most problems come from the Microsoft 365 domain, the user’s licence, or the phone number format.
“Can not use the domain as it was not configured for this tenant”
Section titled ““Can not use the domain as it was not configured for this tenant””When: running New-CsOnlinePSTNGateway.
Cause: the PBX domain (your Microsoft 365 FQDN address) isn’t active in Microsoft 365 yet.
Fix:
- Check that you created a new user with an address on the PBX domain, and gave it a licence that includes Teams. An alias on an existing user doesn’t count. See step 5 of the setup guide.
- If you did, wait. Microsoft can take some time to activate a domain. Then run the command again.
“The term ‘Connect-MicrosoftTeams’ is not recognized”
Section titled ““The term ‘Connect-MicrosoftTeams’ is not recognized””Cause: the Teams PowerShell module isn’t installed or isn’t allowed to run.
Fix:
- Install the current module with
Install-Module -Name MicrosoftTeams, or update an older one withUpdate-Module -Name MicrosoftTeams. - Allow scripts to run with
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned. - Close PowerShell, open it again with Run as administrator, and run
Connect-MicrosoftTeams.
Run Get-Module to see whether the MicrosoftTeams module is loaded. Use Windows PowerShell 5.1; Teams PowerShell has known issues with PowerShell 7.
“Lacks appropriate licenses to assign a ‘DirectRouting’ number” or “Cannot modify the parameter: EnterpriseVoiceEnabled”
Section titled ““Lacks appropriate licenses to assign a ‘DirectRouting’ number” or “Cannot modify the parameter: EnterpriseVoiceEnabled””When: running Set-CsPhoneNumberAssignment or other user commands. The second message mentions a service plan such as MCOProfessional.
Cause: the user doesn’t have the right Microsoft licence.
Fix:
- In the Microsoft 365 admin centre, check the user has a licence that includes Teams plus the Teams Phone Standard add-on. See step 1 of the setup guide.
- If the licences look right, remove them from the user, wait 20 to 30 minutes, assign them again, and run the command again.
“Is not a user policy”
Section titled ““Is not a user policy””When: running Grant-CsOnlineVoiceRoutingPolicy.
Cause: the voice routing policy in your tenant has a different name.
Fix: run Get-CsOnlineVoiceRoutingPolicy to see the name, and use it in -PolicyName.
Calls don’t ring in Teams
Section titled “Calls don’t ring in Teams”Likely causes and fixes:
- The phone number is in the wrong format. It must be in international format, as the portal shows it:
61XXXXXXXXX, not0XXXXXXXXX. Check what Microsoft has withGet-CsOnlineUser -Identity "<email address>"and look at LineURI. To fix it, runSet-CsPhoneNumberAssignmentagain with the right number. - The account isn’t connected in the PBX, or the configuration isn’t applied. Check the account is on a User or SIP trunk and click Apply configuration. See Connect Teams users in the PBX.
- The number is used in your call flow. When a Teams number is in an Inbound number, the call flow decides where it goes, not the static route. Check the call flow sends it to the user or trunk with the Teams account.
- Teams voicemail answers first. Turn off Teams voicemail.
No dial pad in Teams
Section titled “No dial pad in Teams”- Restart the Teams app.
- Microsoft can take up to 48 hours to set up a new user. Wait, then check again.
- Check the user has the phone licence, a phone number (
Set-CsPhoneNumberAssignment) and the voice routing policy (Grant-CsOnlineVoiceRoutingPolicy).
The gateway shows as inactive in the Teams admin centre
Section titled “The gateway shows as inactive in the Teams admin centre”This is expected with this setup and doesn’t mean anything is wrong. Check calls instead.
Calls to a parking slot don’t work
Section titled “Calls to a parking slot don’t work”Blind transfers from Teams to a Call parking slot don’t work as expected. This is a known limitation.
Useful PowerShell commands
Section titled “Useful PowerShell commands”Run Connect-MicrosoftTeams first. Replace <email address> with the user’s Teams email.
| Command | Shows |
|---|---|
Get-InstalledModule |
Installed modules and versions, including MicrosoftTeams. |
Get-Module |
Modules loaded in this session. |
Get-CsOnlineUser -Identity "<email address>" | fl UserPrincipalName |
Whether Microsoft can find the user. |
Get-CsOnlineUser -Identity "<email address>" | fl EnterpriseVoiceEnabled |
Whether the user has voice enabled. |
Get-CsTenantDialPlan |
The dial plans in your tenant. |
Get-CsOnlinePSTNGateway |
The PSTN gateways and their settings. |
Get-CsOnlinePstnUsage |
The global PSTN usages. |
Get-CsOnlineVoiceRoute |
The voice routes and their gateways. |
Get-CsOnlineVoiceRoutingPolicy |
The voice routing policies. |
When to contact support
Section titled “When to contact support”If calls still don’t reach Teams after these checks, raise a support ticket. Include the Teams user’s email address, the phone number, and the exact error message or the time of a failed test call.