Remote PowerShell Login to Microsoft Teams

With Teams you can login in the same way as with SfBO, additionally, Teams Remote PowerShell Login als provides a GUI Login window.

Don't forget to install the AzureADConnect:
https://www.microsoft.com/en-us/download/details.aspx?id=47594


NOTE - MULTI-FACTOR AUTHENICATION:
Beside of Msol you must NOT use the $credential variable. Instead let the connect open the Login Frame

UPDATE 01.12.2019

The latest version of the Teams PowerShell module is 0.9.6, released on November 29, 2018. 


Upgrade to the new module because it fixes some bugs and introduces a very welcome piece of functionality in that your account no longer needs to be a team owner to update the settings for a team. If your account is a global administrator or holds the Teams Service administrator RBAC role, you can update the settings of any team.


NOTE: 
Administrator accounts working with Teams through PowerShell no longer need to be assigned a Teams license.

Upgrade the Teams module: run PowerShell as an administrator and use these commands.

Uninstall-Module -Name MicrosoftTeams
Install-Module -Name MicrosoftTeams -Repository PSGallery


First install the Microsoft Teams PowerShell Module:

Install-Module MicrosoftTeams


With GUI Login:
Connect-MicrosoftTeams





MicrosoftOnlineLogin

Set-ExecutionPolicy RemoteSigned

$credential = Get-Credential
Connect-MsolService -Credential $credential


Microsoft Teams

Connect-MicrosoftTeams -Credential $credential

 This runs the remote signing process as usual. 

SkypeForBusiness (other relevant Teams cmdlets)
Import-Module SkypeOnlineConnector
$SfBoSession = New-CsOnlineSession -Credential $credential
Import-PSSession $SfBoSession



In a hybrid environment:


You have the modify the New-CsOnlineSession command to, if your DNS records for AutoDiscover are pointed to the on-premises server.

$SfBoSession = New-CsOnlineSession –Credential $credential –OverrideAdminDomain "yourdomain.onmicrosoft.com"

you will avoid the "The remote server returned an error. (404) Not Found" error.

Comments

Popular posts from this blog

Cannot join external Lync Meeting: Lync Edge Server Single IP Address (Lync Edge Server Single IP Web Conferenceing Problem)

MFA with Guest Access and different tenants settings

Skype for Business, Lync and Exchange Web Services (EWS) and different DNS Domains- Exchange crawling e.g. for presence