Hello, This will be a short article just to log simple oneliner. Goal is to export existing dialplans from SfB and copy them to Microsoft Teams. Remember, there’s only limited amount of keystroks that one can do in lifetime.

#On SfB server export dialplans
get-csDialplan | export-clixml .\dialplans.xml

#connect to MicrosoftTeams

#In my case there where 22 dialplans. First one is global, I've skipped that by starting from 1.
#and I had to replace some underscores on fly because Teams is not happy having them. 
(Import-Clixml .\dialplans.xml )[1..21].foreach({$dpName=$($_.simpleName.trim() -replace "_","-"); 
New-CsTenantDialPlan -Identity $dpname; 
Set-CsTenantDialPlan -Identity $dpName -NormalizationRules $_.NormalizationRules -OptimizeDeviceDialing $_.OptimizeDeviceDialing -ExternalAccessPrefix $_.ExternalAccessPrefix  })

There is something similar already on docs but, it’s longer :-). Thanks for reading, have a great day!