Unable to change to Teams only mode in Teams Administrator

Working with a customer recently, we had made it to the project stage where we were looking to change their Teams coexistence mode to Teams only. Normally a great time to celebrate in a Teams adoption project! However, we ran into an issue. Upon trying to save the change in the Teams admin console, we were greeted with the message below. The message itself wasn’t constructive as it just highlighted the unsaved sections below.

Unable to change to Teams only mode within Microsoft Teams Administrator

We decided the best course of action hopefully receive some more insight was to try and make the same change from Powershell using the command below.

Grant-CsTeamsUpgradePolicy -PolicyName UpgradeToTeams

Predictably this didn’t work either but did give us an error message we could use to try and resolve the problem.

This organization cannot be upgraded to TeamsOnly at the tenant level because there is an on-premise deployment of Skype for Business detected in 1 or more of it sip domains, PROBLEMDOMAIN. Users can be individually upgraded to TeamsOnly using either Move-CsUser (if the user has an on-premises Skype for Business account) or Grant-CsTeamsUpgradePolicy (if the user is homed in Skype for Business online).

+ CategoryInfo          : NotSpecified: (:) [Grant-CsTeamsUpgradePolicy], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,Microsoft.Rtc.Management.AD.Cmdlets.CopyOcsTeamsUpgradePolicyCmdlet
+ PSComputerName        : api.interfaces.records.teams.microsoft.com

We felt the next best step was to double check that no individual users were set to SfB only mode using the command below. This returned as expected and all users were set to follow domain default.

Get-CsOnlineUser | FT userprincipalname,TeamsUpgradeEffectiveMode

Resolution

Next, we decided to check DNS for the problem domain listed in the error we received back from PowerShell. Note we have hidden this domain above but it is displayed as PROBLEMDOMAIN. This was a domain that was no longer widely used and was only used to capture emails to a legacy domain. Upon investigation of DNS, we found that there was an erroneous wildcard (* ) DNS entry for this domain and this was resulting in Teams picking up that Lync was configured for this domain. Upon correction of this error and giving DNS time to propagate the error went away and we were able to set the coexistence mode to Teams only in the Teams admin console.