Hi @Komal More
Here are two similar threads which may be helpful:
Bulk Assigning Phone Number to Microsoft Teams Users / Direct Routing
To run the script in the thread, you may need to prepare a csv file (named with FILENAME.csv or other file names which matches the file name in the script)
with its format like:
Then save the following script to a ps1 file.
(From the first line change the file path to point to the path of the csv file you prepared)
$teams = Import-Csv "C:\Users\Temp\FILENAME.csv"
foreach ($team in $teams) {
Set-CsPhoneNumberAssignment -identity $team.identityname -PhoneNumber $team.phonenumber -PhoneNumberType DirectRouting
Grant-CsTenantDialPlan -PolicyName "YOURPOLICYNAME" -Identity $team.identityname
Grant-CsTeamsCallingPolicy -PolicyName AllowCalling -Identity $team.identityname
Grant-CsOnlineVoiceRoutingPolicy -PolicyName "YOURPOLICYNAME"-Identity $team.identityname
}
Install Teams Powershell module and connect to Teams Powershell with an account which has the required admin roles (for example Teams admin).
Then run the script.
For example, if the script file's path is C:\Users\TEMP\bulk_assign_number.ps1.
Then run the following cmdlets to execute the script:
cd C:\Users\TEMP
.\bulk_assign_number.ps1
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.