必要條件
在你的電腦上安裝 PowerShell。
設定你的電腦 Windows PowerShell
MSTeams 模組已安裝
Install-Module -Name MicrosoftTeams -Force -AllowClobberMicrosoft 圖模組安裝
Install-Module -Name Microsoft.Graph -Force -AllowClobber
確保你擁有租戶管理權。
購買 Microsoft Teams 電話。
本文提到的代理人、分發名單和 Teams 頻道已經建立完成。
備註
本情境中使用的 Teams Channel 指令碼是 Teams PowerShell 模組公開預覽版的一部分。 欲了解更多資訊,請參閱 安裝 Teams PowerShell 公開預覽 版,也請參閱 Microsoft Teams PowerShell 發布說明。
已安裝 MicrosoftTeams 模組的使用者應 Update-Module MicrosoftTeams 確保安裝的是最新版本。
案例
在此情境中,你會建立以下三個呼叫隊列:
- 銷售電話佇列
- 支援呼叫佇列
- 設施協同呼叫佇列
銷售電話隊列資訊:
- 在自動接待員後方:是的
- PSTN 直撥:不行
- 語言:英語 美國
- 問候:無
- 音樂暫停:播放音訊檔
- 檔案名稱:sales-hold-in-queue-music.wav
- 來電接聽:使用者
- Bill@contoso.com
- Mary@contoso.com
- 會議模式:開啟
- 路由方式:接待員
- 基於存在的路由:關閉
- 客服人員可以選擇不接聽電話:可以
- 呼叫客服人員警報時間:15
- 通話溢出處理:200
- 重定向至: Adele@contoso.com
- 呼叫暫停處理:120秒
- 重定向至: Adele@contoso.com
支援呼叫佇列資訊:
- 在自動接待員後方:是的
- PSTN 直撥:不行
- 語言:英國英語
- 問候:播放音訊檔案
- 檔案名稱:support-greeting.wav
- 音樂暫停:播放音訊檔
- 檔案名稱:support-hold-in-queue-music.wav
- 來電接聽:支援分配名單
- Support@contoso.com
- 會議模式:開啟
- 路由方法:最長閒置
- 基於在席的路由:不適用 – 預設開啟,因為最長閒置
- 客服人員可以選擇不接聽電話:不行
- 呼叫客服人員警報時間:15
- 通話溢出處理:200
- 轉址:支援共享語音信箱
- 播放音訊檔案 (support-shared-voicemail-greeting.wav)
- 已啟用轉錄
- 轉址:支援共享語音信箱
- 呼叫暫停處理時間:45分鐘
- 轉址:支援共享語音信箱
- 轉語音系統:「抱歉讓您久等,現在將您的來電轉接到語音信箱。」
- 已啟用轉錄
- 轉址:支援共享語音信箱
設施協同呼叫隊列資訊:
- 坐在自動服務員後面:沒有
- PSTN 直接撥打:沒有 (內部通話,僅)
- 語言:法語 FR
- 問候:無
- 音樂暫停:預設
- 來電接聽:團隊:設施
- 來電接聽管道:客服台
- 頻道擁有者: Fred@contoso.com
- 會議模式:開啟
- 路由方式:輪轉制
- 基於在場的路由:開
- 客服人員可以選擇不接聽電話:不行
- 呼叫客服人員警報時間:15
- 通話溢出處理:200
- 中斷連線
- 呼叫暫停處理時間:45分鐘
- 中斷連線
登入
當被要求輸入你的 Teams 管理員憑證時。
$credential = Get-Credential
Connect-MicrosoftTeams -Credential $credential
Connect-MgGraph -Credential $credential
銷售排隊
建立音訊Files
將 wav 檔案儲存在你電腦上的路徑替換 d:\\ 成。
$content = [System.IO.File]::ReadAllBytes('d:\sales-hold-in-queue-music.wav')
$audioFileSalesHoldInQueueMusicID = (Import-CsOnlineAudioFile -ApplicationID HuntGroup -FileName "sales-hold-in-queue-music.wav" -Content $content).ID
取得使用者識別碼
$userAdeleID = (Get-CsOnlineUser -Identity "sip:adele@contoso.com").Identity
$userSalesBillID = (Get-CsOnlineUser -Identity "sip:bill@contoso.com").Identity
$userSalesMaryID = (Get-CsOnlineUser -Identity "sip:mary@contoso.com").Identity
取得支援語言列表
Get-CsAutoAttendantSupportedLanguage
建立通話佇列
New-CsCallQueue -Name "Sales" -AgentAlertTime 15 -AllowOptOut $true -MusicOnHoldAudioFileID $audioFileSalesHoldInQueueMusicID -OverflowAction Forward -OverflowActionTarget $userAdeleID -OverflowThreshold 200 -TimeoutAction Forward -TimeoutActionTarget $userAdeleID -TimeoutThreshold 120 -RoutingMethod Attendant -ConferenceMode $true -User @($userSalesBillID, $userSalesMaryID) -LanguageID "en-US"
取得執照類型
Get-MgSubscribedSku
建立並指派資源帳號
這裡不需要電話號碼,因為通話佇列是放在自動接待後面。
- ApplicationID
- 自動接待員:ce933385-9390-45d1-9512-c8d228074e07
- 呼叫佇列:11cd3e2e-fccb-42ad-ad00-878b93575e07
後 (PHONESYSTEM_VIRTUALUSER) 面顯示的授權類型必須是指令長(cmdlet) Get-MgSubscribedSku 中列出的。
New-CsOnlineApplicationInstance -UserPrincipalName Sales-RA@contoso.com -DisplayName "Sales" -ApplicationID "11cd3e2e-fccb-42ad-ad00-878b93575e07"
Update-MgUser -UserId "Sales-RA@contoso.com" -UsageLocation US
Set-MgUserLicense -UserId "Sales-RA@contoso.com" -AddLicenses @(contoso:PHONESYSTEM_VIRTUALUSER) -RemoveLicenses @()
$applicationInstanceID = (Get-CsOnlineUser -Identity "Sales-RA@contoso.com").Identity
$callQueueID = (Get-CsCallQueue -NameFilter "Sales").Identity
New-CsOnlineApplicationInstanceAssociation -Identities @($applicationInstanceID) -ConfigurationID $callQueueID -ConfigurationType CallQueue
支援佇列
建立音訊檔案
將 wav 檔案儲存在你電腦上的路徑替換 d:\\ 成。
$content1 = [System.IO.File]::ReadAllBytes('d:\support-greeting.wav')
$audioFileSupportGreetingID = (Import-CsOnlineAudioFile -ApplicationID HuntGroup -FileName "support-greeting.wav" -Content $content1).ID
$content2 = [System.IO.File]::ReadAllBytes('d:\support-hold-in-queue-music.wav')
$audioFileSupportHoldInQueueMusicID = (Import-CsOnlineAudioFile -ApplicationID HuntGroup -FileName "support-hold-in-queue-music.wav" -Content $content2).ID
$content3 = [System.IO.File]::ReadAllBytes('d:\support-shared-voicemail-greeting.wav')
$audioFileSupportSharedVoicemailGreetingID = (Import-CsOnlineAudioFile -ApplicationID HuntGroup -FileName "support-shared-voicemail-greeting.wav" -Content $content3).ID
取得支援團隊群組編號
$teamSupportID = (Get-Team -DisplayName "Support").GroupID
取得支援語言列表
Get-CsAutoAttendantSupportedLanguage
建立通話佇列
New-CsCallQueue -Name "Support" -AgentAlertTime 15 -AllowOptOut $false -DistributionLists $teamSupportID -WelcomeMusicAudioFileID $audioFileSupportGreetingID -MusicOnHoldAudioFileID $audioFileSupportHoldInQueueMusicID -OverflowAction SharedVoicemail -OverflowActionTarget $teamSupportID -OverflowThreshold 200 -OverflowSharedVoicemailAudioFilePrompt $audioFileSupportSharedVoicemailGreetingID -EnableOverflowSharedVoicemailTranscription $true -TimeoutAction SharedVoicemail -TimeoutActionTarget $teamSupportID -TimeoutThreshold 2700 -TimeoutSharedVoicemailTextToSpeechPrompt "We're sorry to have kept you waiting and are now transferring your call to voicemail." -EnableTimeoutSharedVoicemailTranscription $true -RoutingMethod LongestIdle -ConferenceMode $true -LanguageID "en-US"
取得執照類型
Get-MgSubscribedSku
建立並指派資源帳號
這裡不需要電話號碼,因為通話佇列是放在自動接待後面。
- ApplicationID
- 自動接待員:ce933385-9390-45d1-9512-c8d228074e07
- 呼叫佇列:11cd3e2e-fccb-42ad-ad00-878b93575e07
後 (PHONESYSTEM_VIRTUALUSER) 面顯示的授權類型必須是指令長(cmdlet) Get-MgSubscribedSku 中列出的。
New-CsOnlineApplicationInstance -UserPrincipalName Support-RA@contoso.com -DisplayName "Support" -ApplicationID "11cd3e2e-fccb-42ad-ad00-878b93575e07"
Update-MgUser -UserId "Support-RA@contoso.com" -UsageLocation US
Set-MgUserLicense -UserId "Support-RA@contoso.com" -AddLicenses @(contoso:PHONESYSTEM_VIRTUALUSER) -RemoveLicenses @()
$applicationInstanceID = (Get-CsOnlineUser -Identity "Support-RA@contoso.com").Identity
$callQueueID = (Get-CsCallQueue -NameFilter "Support").Identity
New-CsOnlineApplicationInstanceAssociation -Identities @($applicationInstanceID) -ConfigurationID $callQueueID -ConfigurationType CallQueue
設施協同呼叫佇列
取得設施團隊群組識別碼
$teamFacilitiesGroupID = (Get-Team -DisplayName "Facilities").GroupID
取得設施客服團隊頻道識別碼
Get-TeamChannel -GroupId $teamFacilitiesGroupID
$teamFacilitiesHelpDeskChannelID = "{assign ID from output of above command}"
取得設施客服台頻道擁有者使用者 ID
$teamFacilitiesHelpDeskChannelUserID = (Get-TeamChannelUser -GroupId $teamFacilitiesGroupID -DisplayName "Help Desk" -Role Owner).UserId
代表 Calling Resource Account ID 聯絡
$oboResourceAccountID = (Get-CsOnlineUser -Identity "MainAA-RA@contoso.com").Identity
取得支援語言列表
Get-CsAutoAttendantSupportedLanguage
建立通話佇列
New-CsCallQueue -Name "Facilities" -AgentAlertTime 15 -AllowOptOut $false -ChannelId $teamFacilitiesHelpDeskChannelID -ChannelUserObjectId $teamFacilitiesHelpDeskChannelUserID -ConferenceMode $true -DistributionList $teamFacilitiesGroupID -LanguageID "fr-FR" -OboResourceAccountIds $oboResourceAccountID -OverflowAction DisconnectWithBusy -OverflowThreshold 200 -RoutingMethod RoundRobin -TimeoutAction Disconnect -TimeoutThreshold 2700 -UseDefaultMusicOnHold $true
取得執照類型
Get-MgSubscribedSku
建立並指派資源帳號
這裡不需要電話號碼,因為通話佇列是放在自動接待後面。
- ApplicationID
- 自動接待員:ce933385-9390-45d1-9512-c8d228074e07
- 呼叫佇列:11cd3e2e-fccb-42ad-ad00-878b93575e07
後 (PHONESYSTEM_VIRTUALUSER) 面顯示的授權類型必須是指令長(cmdlet) Get-MgSubscribedSku 中列出的。
New-CsOnlineApplicationInstance -UserPrincipalName Facilities-RA@contoso.com -DisplayName "Facilities" -ApplicationID "11cd3e2e-fccb-42ad-ad00-878b93575e07"
Update-MgUser -UserId "Facilities-RA@contoso.com" -UsageLocation US
Set-MgUserLicense -UserId "Facilities-RA@contoso.com" -AddLicenses @(contoso:PHONESYSTEM_VIRTUALUSER) -RemoveLicenses @()
$applicationInstanceID = (Get-CsOnlineUser -Identity "Facilities-RA@contoso.com").Identity
$callQueueID = (Get-CsCallQueue -NameFilter "Facilities").Identity
New-CsOnlineApplicationInstanceAssociation -Identities @($applicationInstanceID) -ConfigurationID $callQueueID -ConfigurationType CallQueue