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 MicrosoftTeams

*Accept the repository change if required.

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 comming soon

Import-Module SkypeOnlineConnector

Image comming soon

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

Import-PSSession $session

Image comming soon