When migrating from Skype for Business Server to Microsoft Teams you may find that users are not migrated with the correct features as intended. If the migration also includes moving Enterprise Voice workloads and switching to a Direct Routing or Calling Plan setup, you may find it difficult to get a full overview of what state the user is in and if all settings are correct.
I found that this Skype for Business Online PowerShell oneliner gave me the overview I needed to see if there were configuration issues or wrong settings. Hope this helps you in your post-migration cleanup process
Get-CsOnlineUser ken.myer@contoso.com | Format-List UserPrincipalName, DisplayName, SipAddress, Enabled, TeamsUpgradeEffectiveMode, EnterpriseVoiceEnabled, HostedVoiceMail, City, UsageLocation, DialPlan, TenantDialPlan, OnlineVoiceRoutingPolicy, LineURI, OnPremLineURI, OnlineDialinConferencingPolicy, TeamsVideoInteropServicePolicy, TeamsCallingPolicy, HostingProvider, InterpretedUserType, VoicePolicy, CountryOrRegionDisplayName

- TeamsUpgradeEffectiveMode – Should be set to TeamsOnly, if not, try to change it again and look at the error message
- UsageLocation, DialPlan, and TenantDialPlan – When using enterprise voice together with Microsoft Teams, UsageLocation is important. It decides the number you get as part of AudioConferencing and your DialPlan. The default DialPlan just adds a plus and country code to whatever you type in Teams and is rarely good enough. You should supplement with TenantDialplans, don’t crate them yourself, use https://www.ucdialplans.com/ by MVP Ken Lasko. UsageLocation is set using the MSol PowerShell module.
- LineURI, OnPremLineURI, and VoicePolicy – if your VoicePolicy is set to BusinessVoice you have a Calling Plan assigned, if it is set to HybridVoice, you are using Direct Routing. This is good to know if you are troubleshooting why LineURI is not updated by OnPremLineURI for Direct Routing. You should also know that if you are not able to set OnPremLineURI using Set-CsUser using online PowerShell, then you have msRTCSIP-LineURI populated in local Active Directory. If you clear this attribute, you get write access to the OnPremLineURI online.
- InterpretedUserType – is a great source of information. It tells you the status of the user. If you have any attributes in local Active Directory it will be set to HybridOnpremSfBUser. If for some reason the user is disabled it will show in this attribute as something with disabled such as DirSyncDisabledSfBUser. Read this useful GitHub article that goes into this in more detail
If InterpretedUserType has the value of HybridOnpremSfBUser, then you need to clean up on-premises attributes if you are fully moving to Microsoft Teams and are decommissioning your on-premises deployment. The best way is to use Disable-CsUser to remove all Skype for Business related attributes on a user. More often than not, we see that this command is not run before decommissioning the deployment, so you need to remove the properties manually, here is a routine to detect all msRTCSIP attributes and then to clear them in Active Directory. Based on the type of configuration the user had before servers were removed, the properties with a value may be different per user so using ‘msRTCSIP*’ is a good way to catch the attributes for that specific user.
#Get all msRTCSIP properties for a user that has a value
$Properties = Get-ADUser -Filter {UserPrincipalName -eq "<UPN>"} -Properties * | Select-Object -Property 'msRTCSIP*'
#Clear all properties for a user
Get-ADUser -Filter {UserPrincipalName -eq "<UPN>"} -Properties * | Set-ADUser -clear ($Properties | Get-Member -MemberType "NoteProperty" | % { $_.Name })
You have OnlineVoiceRoutingPolicy in the command twice.
Good catch, fixed :)
Hi there! I’m dealing with some similar issues here regarding the InterpretedUserType, and have attempted to run the two commands you have listed. The first appears to retrieve the required data in the background, but the second presents a ‘Set-ADUser : The parameter is incorrect at line:1 char:91’ error. Any help would be greatly appreciated!
Thanks for the article! I am running into an error running your second command, to clear the AD attributes. ‘Set-ADUser : The parameter is incorrect At line:1 char:91. Any ideas?
Thanks for the article! When I run Get-ADUser -Filter {UserPrincipalName -eq “my.user@contoso.com”} -Properties * | Set-ADUser -clear ($Properties | Get-Member -MemberType “NoteProperty ” | % { $_.Name }) I get the following error – Set-ADUser : The parameter is incorrect At line:1 char:91. Any help would be greatly appreciated! Sorry if this has posted three times…had problems with my account.
Hi, what is the value of $Property before you run the command?
Anyone know who to clear the msRTCSIP attribute after you have stopped the AD sync and deleted the on-premises AD completely.
Getting the following when trying to setup an SBC to Teams.
Can not update OnPremLineURI as the user has dirsynced onpremise LineURI.
if you are using Active Directory synchronization then this error could be resolved by clearing the msRTCSip-Line attribute in Active Directory and doing a sync to Azure AD
Only Microsoft can do it in this case
in our setup i see many user’s OnlineDialinConferencingPolicy set to blank. how can i set this to ServiceAllowed to have Dial-In configuration enabled?
The only thing I know is that thsy do no have an audio conferencing license assigned. If you have, it may be that you do not have enough licenses
Nice article, it was very useful to retire my on-premises SfB components. And lo an behold, I had revisit it after a few weeks when I found a couple of accounts I forgot apply Disable-CsUsers before cutting the cord. Thanks!
i really hope this is still actively being listened to I’m experiencing an issue i think i would have heard more about but cant seem to find the fix for. I currently run ad synced to office365 the lineuri is determined by a value in our on prem AD I cant seem to find the right command to change it so that i can change numbers/make new numbers for users on teams. any idea what commands would be used to do this?
First off, you need to remove the number in active directory, then you need to run set-csuser Identity and onprem Lineuri in the same format using tel: assuming you are using direct routing