Teams: Powershell Login

Tutorials/MSTeams/
  • Teams: Powershell Login
  • Teams: Powershell Login


    Disclaimer: Run PowerShell at your own risk, the information below is to help, please do your own research and check errors you may receive.


    1. Open PowerShell as Admin

    PowerShell Screen below:

    2. Install Teams Module

    Command:

    Install-Module -Name MicrosoftTeams -RequiredVersion 1.1.6

    *Accept the repository change if required.

    ** Note that Teams module 1.1.6 is required for the commands below. Once installed you can check your module with Get-InstalledModule

    If you have any newer versions please be sure to unistall the teams module with Uninstall-Module MicrosoftTeams and run the install command with -RequiredVersion 1.1.6, you may need to prepend with -AllowClobber

    3. Import Teams Module

    Command:

    Import-Module MicrosoftTeams

    4. Set ExecutionPolicy

    Command:

    Set-ExecutionPolicy RemoteSigned

    Enter a for "Yes to All"

    5. Run Login Command

    $credential = Get-Credential

    #Connect to Microsoft Teams

    Connect-MicrosoftTeams -Credential $credential

    #Connection to Skype for Business Online and import into Ps session

    $session = New-CsOnlineSession -Credential $credential

    Import-PsSession $session

    6. Enter Teams Admin Login and Password

    7. You are logged into Teams Via PowerShell, you can now run your "Get" commands for setting up your PSTN and routes.


    Optional Login Method

    Commands: (run as admin)

    Set-ExecutionPolicy RemoteSigned

    Image coming soon

    Import-Module SkypeOnlineConnector

    Image coming soon

    $session = New-CsOnlineSession -Credential $cred -OverrideAdminDomain "yourdomain(example: xxxx.onmicrosoft.com"

    Import-PSSession $session

    Image coming soon