Set up Microsoft PowerShell for configuring Microsoft Teams

If you don't want to use the Teams Connector setup wizard or want to make advanced settings of Microsoft Teams' Direct Routing, you may need to use Microsoft's PowerShell command line. We will show you how to set this up.

Setting up PowerShell

These steps must be done once on each computer that will be used to set up and/or configure Microsoft Teams (via PowerShell).

Start PowerShell as an administrator and enter the following commands in the following order:

  1. Get-Host | Select-Object Version
    Checks the current version of PowerShell. The output should show at least "Version 5.1.x". If an older version is installed, please update it from the Microsoft Download Center.
  2. Set-ExecutionPolicy RemoteSigned -Force
    Restriction of additional modules to trusted scripts.
  3. Get-ExecutionPolicy
    ? Checking the status for remote scripts. The output should be as follows: "RemoteSigned".
  4. Get-Service winrm
    Checks the current status of WinRM. The output should be: "running". If not "running", please continue with point 5.
    Otherwise you can jump directly to point 6.
  5. Start service winrm
    Starts WinRM. For safety, please check the status again with "Get-service winrm".
  6. Install-Module MicrosoftTeams
    Installs the required Microsoft Teams module.
    In this step, there may be different hints that need to be considered accordingly. In the next section you will find some examples.

Known issues & their solution

  • Missing NuGet provider.
    Solution: Here the message should be answered with "Yes".
  • The module to be installed is marked as "not trusted".
    Solution: Here the message should be acknowledged with A - Yes all that the installation will continue.
  • A pre-release version of the Microsoft Teams module is already installed.
    Solution: To work around this message, please use the customized installation command for version 2.0.0 of the Microsoft Teams Module at this point: "Install-Module MicrosoftTeams -Force".