Teams Remote PowerShell Session
Teams PowerShell Module – versions older than 4.x.x were retired on June 15, 2022 and will no longer work
https://admin.microsoft.com/Adminportal/Home?ref=MessageCenter/:/messages/MC350371
Please read through the following article: https://docs.microsoft.com/en-us/microsoftteams/teams-powershell-supported-versions
Teams PowerShell Module Installation
To configure Think365 Cloud Voice and enable users for Enterprise Voice, a Teams Remote PowerShell session must first be established.
PowerShell 5.1 and .NET 4.8 are pre-requisites.
- Test for PowerShell version: 5.1 and 7.2 are both supported. 7.0 and 7.1 are not supported and will fail to function properly.
Get-Host | Select-Object Version
If running Windows 10, you should be automatically running version 5.1.
If running PS from a Lync Skype Frontend server, you will likely need to install WMF 5.1: https://docs.microsoft.com/en-us/powershell/scripting/windows-powershell/install/installing-windows-powershell?view=powershell-7.1#upgrading-existing-windows-powershell
Installing or upgrading Windows PowerShell
- Set the Execution Policy:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
- Install the PowerShellGet module with one of the following commands:
Install-Module PowerShellGet -Force -AllowClobber
Or
Install-Module -Name PowerShellGet -Repository PSGallery -Force - Install the .NET 4.8
https://support.microsoft.com/en-us/topic/microsoft-net-framework-4-8-offline-installer-for-windows-9d23f658-3b97-68ab-d013-aa3c3e7495e0
- You Can install the Teams PowerShell module in one of two ways:
Directly install from PowerShell with the following command
Install-Module -Name MicrosoftTeams
Or
Install-Module -Name MicrosoftTeams -RequiredVersion "6.5.0"
OR
Download and install the Microsoft Teams Windows PowerShell Module:
https://www.powershellgallery.com/packages/MicrosoftTeams/6.5.0
Open a PowerShell window as administrator and run the following command to import the Teams PowerShell module:
Import-Module -Name MicrosoftTeams
- Restart the Windows PowerShell window
- Run the following command to sign in with your Office 365 administrator account:
Connect-MicrosoftTeams
Note: The above steps will need to be repeated any time a remote session is required for future administration. To end the session, run: Disconnect-MicrosoftTeams
Note: For installing on a Skype for Business servers, please review the following articled for installation requirements. When migrating from an Onprem environment, it is highly recommended to be on the lastest Cumulative Update (Aug 2021), but there are additional requirements that are often overlooked.
To apply this update, you must have the following installed:
- Microsoft .NET Framework 4.7.2 or a later version (4.8 is supported), either Offline Installer or Web Installer
- PowerShell 5.1
- The current version of the PowerShellGet module (requires the ability to download directly from PSGallery)
Enable a User
The following steps are required to enable Think365 Cloud Voice users.
Request a new phone number, if required, via a ThinkTel support ticket. (support@thinktel.ca, http://support.thinktel.ca, 1-866-928-4465) Alternatively, existing customer phone numbers can be ported from other carriers. Note: ThinkTel will require 911 address information before any number can be activated.
Assign a Teams Phone Standard license to an active Office 365 user account. (Assign a Add-on license) E1 or E3 require Phone Standard to be added. E5 includes Phone Standard.
Using the Teams Remote PowerShell session, to enable a user for Enterprise Voice you must assign a phone number and voice routing policy using the following commands:
The following command needs to be ran to enable a user for Enterprise Voice:
Set-CsPhoneNumberAssignment -Identity user@domain.com -PhoneNumber '+1xxxxxxxxxx' -PhoneNumberType DirectRouting
To assign the Think365 voice routing policy, run the following:
Grant-CsOnlineVoiceRoutingPolicy -Identity user@domain.com -PolicyName "ThinkTel"
Users may already be enabled for Voicemail so this command might not be required
Set-CsOnlineVoiceMailUserSettings -Identity user@domain.com -VoicemailEnabled $true
Optionally, you can verify a user was assigned the correct parameters with the following command:
Get-CsOnlineUser user@domain.com | fl FeatureTypes, WhenChanged, *Interpreted*, TeamsUpgradeEffectiveMode, *DialPlan, *DialOut*, Host*, *voice*, *sip*, *lineuri*
To assign a ThinkTel Direct Routing phone number to a resource account (e.g Cloud AA) use the same command as for users:
Set-CsPhoneNumberAssignment -Identity resource@domain.onmicrosoft.com -PhoneNumber '+1xxxxxxxxxx' -PhoneNumberType DirectRouting
Optional:
Grant-CsOnlineVoiceRoutingPolicy -Identity resource@company.onmicrosoft.com -PolicyName "ThinkTel"
Disable a User
The following steps can be used to disable a user’s Phone System functionality:
Cancel the phone number via a ThinkTel support ticket. (support@thinktel.ca, http://support.thinktel.ca, 1-866-928-4465) Alternatively, the phone number can be reassigned or reserved.
Within the Teams Remote PowerShell session, disable the user’s Phone System and Think365 Cloud Voice functionality with the following two commands:
Grant-CsOnlineVoiceRoutingPolicy -Identity user@domain.com -PolicyName $null
Remove-CsPhoneNumberAssignment -Identity user@domain.com -RemoveAll
Remove the user’s Phone Standard license in the Office 365 admin portal.
It is important to remember to remove the phone number assignments and then the licenses before deleting/removing a User Account or a Resource Account. Failure to do so can result in the inability to reuse that phone number again for another user or account.
Additional Teams PowerShell Module Links
Some additional useful PowerShell commands:
The following Get-CsOnlineUser command pulls down selected details for all the users and displays in a GridView
Get-CsOnlineUser | Select DisplayName,SipAddress,LineURI,OnlineVoiceRoutingPolicy,*Interpreted*,MCOValidationError,*Calling*,TeamsUpgradeEffectiveMode,TeamsUpgradePolicy,*DialPlan,VoicePolicy,TeamsMeetingPolicy,ExternalAccessPolicy,OnlineDialinConferencingPolicy,TeamsCallingPolicy | Sort DisplayName | Out-GridView
Or, same thing except with a filter for users with a LineURI
Get-CsOnlineUser -Filter {lineuri -ne $Null} | Select DisplayName,SipAddress,LineURI,OnlineVoiceRoutingPolicy,*Interpreted*,MCOValidationError,*Calling*,TeamsUpgradeEffectiveMode,TeamsUpgradePolicy,*DialPlan,VoicePolicy,TeamsMeetingPolicy,ExternalAccessPolicy,OnlineDialinConferencingPolicy | Sort DisplayName | Out-GridView
Optionally you can replace Out-GridView with:
Export-Csv -Path C:\Temp\CsOnlineUser.csv -NoTypeInformation
This sets the source of most Microsoft PowerShell modules as Trusted and removes the prompt to install any updated modules
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
To update the Teams PowerShell Module
Update-Module MicrosoftTeams
Update all installed PowerShell modules just run:
Update-Module
To show more data in long results, run the following or add to your PS Profile, to remove ellipses…
$formatenumerationlimit = -1
Clients and Devices
Devices
For optimal user experience, it is important to use clients and devices certified for Microsoft Teams.
Client Downloads
Desktop Clients are available for Windows (7+) and Mac OSX. Mobile clients are available for iOS, Android and Windows Phone. Download links for all clients can be found here: https://teams.microsoft.com/downloads
Microsoft Teams can also be accessed via a Web client. The URL to access the Web client is as follows: https://teams.microsoft.com
ThinkTel Technical Support
Should it be required, customers can open a ticket with ThinkTel’s support team to troubleshoot issues related to the Think 365 Cloud Voice. ThinkTel support can be reached through the following methods:
- Emailing support at support@thinktel.ca. This will generate a ticket with the level 1 support team with the default 4-hour SLA. Tickets are answered during regular business hours of 9am to 9pm EST.
- Create a ticket at https://helpcentre.thinktel.ca/contact-us.
- 1-888-852-2381
- All methods will generate a ticket with the level 1 support team with the default 4-hour SLA. Tickets are answered during regular business hours of 8am to 8pm EST Monday to Friday.