Enabling Enterprise Voice is straightforward, but what if you need to enable Enterprise Voice for all users in your organisation that are configured to use the Teams Phone system, quickly and efficiently?
In this tutorial, I am going to show you how to use Microsoft Teams PowerShell to enable Enterprise Voice for a single user and multiple users in your organisation, while filtering for all users licensed for the phone system features and using PowerShell loops.
What is Enterprise Voice in Teams?
Enterprise Voice is a feature of Microsoft Teams that allows your organisation to use Teams as a phone system. With Enterprise Voice you can use features such as Auto Attendants (Interactive Voice Response), Call Queues (calling groups), Call Routing and Voicemail to manage inbound calls to your organisation from the PSTN (Public Switched Telephone Network).
Every user who wants to make and receive calls from sources external to their organisation over the public switched telephone network will need to be enabled for Enterprise Voice. This can currently only be achieved by using PowerShell.
Requirements to Enable Enterprise Voice
If you are managing numbers on-premises, such as with Direct Routing or Operator Connect and not using native Teams Calling, you will need to enable Enterprise Voice for all of your users.
However, before you enable Enterprise Voice, you must first ensure your users are correctly licensed to use the Teams Phone System.
Without the correct license assigned, when you try to enable Enterprise Voice for a user, they will receive the following error: Microsoft.Teams.ConfigAPI.Cmdlets.internal\Set-CsPhoneNumberAssignment : The user ‘User Guid’ does not have required licenses to set attributes At %modulepath%
The following licenses will allow you to enable Enterprise Voice:
- Teams Phone Standard (Add-on)
- Microsoft 365 E5 (Included within)
- Microsoft 365 A5 (Included within)
- Microsoft 365 G5 (included within)
For licenses that enable you to use the Teams phone system without needing to purchase an add-on, the feature is called the ‘Microsoft 365 Phone System‘.
You can check this is enabled by following the below steps:
1. Log in to Microsoft Entra.
2. Expand Users and select All Users.
3. Select your target user from the list. Once you have opened the user, under Manage select Licenses.
4. Click on the license which includes the Microsoft 365 Phone System feature and ensure it is enabled in the list.
Enable Enterprise Voice with PowerShell
Enabling enterprise voice requires you to have the Microsoft Teams PowerShell installed. Use the below command to install the Microsoft Teams PowerShell module in the current user context:
Install-module MicrosoftTeams -scope CurrentUser -force
Once the module is installed, you can connect to Microsoft Teams with the Connect-MicrosoftTeams command. You will need to log in as a user with at least the Teams Administrator role.
Connect-MicrosoftTeams
To enable enterprise voice for a single user in your organisation, you can use the following command with Microsoft Teams PowerShell:
Set-CsPhoneNumberAssignment -Identity "Username" -EnterpriseVoiceEnabled $true
Enable Enterprise voice for all users with PowerShell
To enable Enterprise Voice for multiple users at once, you will need to use the loop function in PowerShell to cycle through multiple users efficiently.
For more examples of using loops with PowerShell, check out my blog How to Use a Powershell Foreach Loop With Examples.
Firstly, you will need to identify and gather users who need Enterprise Voice enabling. To do this, use the Get-CsOnlineUser command with a filter that finds users who have the PhoneSystem feature enabled for their account and EnterpriseVoice disabled.
$users = Get-csonlineuser -Filter "EnterpriseVoiceEnabled -eq 'False' -AND FeatureTypes -contains 'PhoneSystem'"
You can then loop through each user to enable Enterprise Voice:
Foreach ($user in $users){
Write-host "Enabling Enteprise Voice for $($user.DisplayName)"
Set-CsPhoneNumberAssignment -Identity $user.UserPrincipalName -EnterpriseVoiceEnabled $true
}