Recently one of our users reported that the voicemail prompt he got whilst trying to leave a message for a second user was in “American English.” He knew this because he heard “Press the pound sign” as opposed to “Press the hash sign.”
Users can manually change this setting by going into their Teams client, click on Settings > Calls > Configure voicemail button.
In the “Greeting language” menu, the default language has been set to “English (United States).” This language is based on the setting specified in the Microsoft 365 admin center’s Organization profile. See “Change the system language for everyone in your organization”
Unfortunately, selecting English here sets the system language to English (United States). To change this to English (United Kingdom) for instance, the user needs to select the drop-down and choose from the presented options.
To achieve same using PowerShell, Microsoft has the Set-CsOnlineVoicemailUserSettings cmdlet which is used to modify the online voicemail user settings of a specific user.
This is a user setting and not a global one.
However, what if as I later found out you needed to set this for your tenant? Well, there is no tenant switch and the ForEach statement comes in handy here.
What a colleague pointed out to me was that running the Get-CsOnlineUser was not sufficient to identify users with a Cloud Voicemail – as a matter of fact, the command pulled up Auto-Attendant resource accounts and some objects on-premises.
To get around this we could isolate Teams users with the:
Get-CsOnlineUser | Where {$_.RegistrarPool -ne $Null}. There was a problem with this as well in our tenant and the user count was not accurate (albeit off by just two objects).
Get-CsOnlineUser | Where {$_.HostedVoiceMail -ne “SRV”} worked to an extent. What I found that worked was:
Get-CsOnlineUser | Where {$_.RegistrarPool -like “*sippool*”}. This was perfect for my requirements.
Then on to writing the script itself.
A simple:
ForEach ($user in $users) {Set-CsOnlineVoicemailUserSettings -Identity $user.UserPrincipalName -PromptLanguage en-GB}
was not going to cut it. The CsOnlineSession could time out seeing that I had about 30,000 users to change this setting for.
This is what I eventually resorted to use:
##Edited on the 21/05/2021##
Microsoft is retiring the Skype for Business Online PowerShell Module
The commands below need to be adjusted to reflect this.
######### Step 1 ################################################################
######### Connect to Microsoft Teams ############################################
######### Run this section first ################################################
Instead of $sfbSession = New-CsOnlineSession
Uninstall the Skype for Business Online Connector PowerShell module from the Control Panel
If you already have the Teams PowerShell module installed you can install the latest version by running:
Install-Module MicrosoftTeams -Force
The Update-MicrosoftTeams command also works
Import-Module MicrosoftTeams
No need to import any PS session
#Import-PSSession $sfbSession
Connect-MicrosoftTeams
Here are what the commands to connect to Teams look like
Import-Module MicrosoftTeams
Connect-MicrosoftTeams
That’s it.
########## Step 2 ################################################################
########## Then run this to export the user list into a CSV file #################
Get-CsOnlineUser -ResultSize Unlimited | Where {$_.RegistrarPool -like “*sip*”} | Export-Csv -NoTypeInformation C:\Temp\CsOnlineUsers.csv
$users = Import-Csv C:\Temp\CsOnlineUsers.csv
########## Step 4 ################################################################
$configuredlist = Import-Csv C:\Temp\ConfiguredUsers.csv
######### Step 3 #################################################################
######### Apply the PromptLanguage parameter to all users ########################
#Remove-Item C:\Temp\ConfiguredUsers.csv
$final = @()
ForEach ($user in $users)
{
if ($user.UserPrincipalName -in $configuredlist.User)
{
“$($user.UserPrincipalName) is already configured”
continue
}
else
{
$user.UserPrincipalName
$change = Set-CsOnlineVoicemailUserSettings -Identity $user.UserPrincipalName -PromptLanguage “en-GB”
$enabledObj = New-Object PSObject
$enabledObj | Add-Member -MemberType NoteProperty -Name User -Value $user.UserPrincipalName
$enabledObj | Add-Member -MemberType NoteProperty -Name PromptLanguage -Value $change.PromptLanguage
$final += $enabledObj
}
}
$final | Export-Csv -NoTypeInformation C:\Temp\ConfiguredUsers.csv -Append
######## Step 5 #################################################################
## Remove PSSession
Get-PSSession | Remove-PSSession
Now that you have changed the prompt to your desired language for the current users in the tenant, you must think of the on-boarding method to modify this setting for new users. This could be part of the user creation process – say a task that runs after 24 hours.