MICROSOFT TEAMS TELEPHONY
Configure Microsoft Teams users for Enterprise Voice
#1 Does user have Office 365 user account
#2 Check Microsoft Phone License is assigned
#3 Get User Password Permission
#4 Add user to Azure AD group
#5 Get-CsOnlineUser -Identity "username@domainname.com" | fl RegistrarPool,OnPremLineUriManuallySet,OnPremLineUri,LineUri
#6 Set-CsUser -Identity "username@domainname.com" -EnterpriseVoiceEnabled $False -HostedVoiceMail $False
#7 Set-CsUser -Identity "username@domainname.com" -EnterpriseVoiceEnabled $true -HostedVoiceMail $true -OnPremLineURI tel:+15555555555
#8 Grant-CsOnlineVoiceRoutingPolicy -Identity "username@domainname.com" -PolicyName "VoiceRouteName"
#9 Grant-CsTenantDialPlan -Identity "username@domainname.com" -PolicyName "DialPlanName"
!!! -Huge cavoite here. Each user that you intend to enable for enterprise voice must have the appropriate licensing. If the user does not have the Microsoft Phone System license the script will fail for that user.
START
Prerequisites on your PC
Install the Skype Pwershell Connector
ON YOUR PC
Connect to Skype via Powershell
Start Powershell ISE as administrator
In the run line type PowerShell. Select "Run as Administrator"
CONNECT TO SKYPE
Copy and paste the below lines into the upper portion of Powershell ISE:
Import-Module SkypeOnlineConnector
$sfbSession = New-CsOnlineSession
Import-PSSession $sfbSession
Enable-CsOnlineSessionForReconnection
Result will look like this.
Type in your UPN credentials: usersname@domainname.com
For Two-Factor authentication you will get the Microsoft login screen
After entering your password you will receive your code from Microsoft. Type it in and click verify
Once the code is accepted PowerShell will load the commands for Skype.
Delete any previous code from the Script area of PowerShell
"Make sure the file path and file name are correct for your use:"
Paste the code below into the upper area of Powershell ISE:
$users = Import-Csv c:\temp\Teams\Users.csv
# Loop for all users in the csv
foreach ($solouser in $users)
{
#reform variables.
$solouserUPN = $solouser.UPN
$solouserLineURI = $solouser.LineURI
Write-Output $solouserUPN
# Enterprise voice enable for user
Set-CsUser -Identity $solouserUPN -EnterpriseVoiceEnabled $False -HostedVoiceMail $False -OnPremLineURI $solouserLineURI
Start-Sleep -Milliseconds 5000
# Enterprise voice enable for user
Set-CsUser -Identity $solouserUPN -EnterpriseVoiceEnabled $true -HostedVoiceMail $true -OnPremLineURI $solouserLineURI
Start-Sleep -Milliseconds 5000
# assign voice routing policy to user
Grant-CsOnlineVoiceRoutingPolicy -Identity $solouserUPN -PolicyName "VRP_US_AuburnHills" -ErrorAction Continue
Start-Sleep -Milliseconds 5000
# assign dial plan to user
Grant-CsTenantDialPlan -Identity $solouserUPN -PolicyName "DIAL-PLAN-US-AuburnHills" -ErrorAction Continue
Start-Sleep -Milliseconds 5000
}
"Again: Make sure your CSV file is in the right format and in the correct folder in the Import path above."
For each row you will see the UPN output and if successful then the script will move to the next user. If not it will produce errors and then move on to the next the csv file.
When finished you can run this command to check the user information:
Get-CsOnlineUser -Identity "username" | fl RegistrarPool,OnPremLineUriManuallySet,OnPremLineUri,LineUri
Thanks and feel free to comment if you have any questions.
Comments
Post a Comment