Home/Connecting to Teams PowerShell environment

Connecting to Teams PowerShell environment

Many administration tasks for Teams require the use of PowerShell.  To connect to the Teams environment via PowerShell, do the following:

    1. Launch an elevated (administrator) PowerShell console by clicking Start, typing PowerShell, right-click and select Run As Administrator

    2. If this is the first time you’re doing this, you must install the Teams module:
      Install-Module MicrosoftTeams
    3. Sign in using modern authentication (must have MFA)
      Replace <UPN> with a username@domain with administrator access
      #Connect to Microsoft Teams 
      Connect-MicrosoftTeams -AccountId <UPN> 
      
      #Connection to Skype for Business Online and import into Ps session 
      $session = New-CsOnlineSession 
      Import-PsSession $session
Last updated 25 February 2026