SOLVED

Cannot perform any actions after entered Connect-MicrosoftTeams cmdlet

Bronze Contributor

Hello guys,

 

Does anyone encountered this issue recently? When I was entered the cmdlet with Connect-MicrosoftTeams and authenticated successfully in the PS window, I run other Teams PS cmdlets it just says "Run Connect-MicrosoftTeams before running cmdlets".

 

Since my account was enabled with MFA and I was using this method without any issue before...

See below screenshot for your reference.

MicrosoftTeams-image (18).png

4 Replies
best response confirmed by Little_Joe (Bronze Contributor)
Solution
That's a known issue with the new Teams module. It is supposed to create a remote PowerShell session to the SfBO backend the first time you try to execute a *cs* cmdlet, yet this often fails. Reconnecting/reloading the module/opening new PowerShell console eventually works, but it's not consistent.
Hi Vasil,

Thanks for the reply.

Yes, I found the issue is probably related to the Teams PowerShell Module version 2.5.0. When I try with 2.3.1 it is working!

The screen shot looks as if it's reporting an error with 2.3.1. A change to Connect-MicrosoftTeams is in 2.5 (from release notes):

The Access Token login for Connect-MicrosoftTeams now uses a unified token array instead of separate parameters for each resource access token. See https://docs.microsoft.com/en-us/powershell/module/teams/connect-microsoftteams?view=teams-ps for more details.

What kind of connection were you trying?

I'm experiencing the same problem when I run the cmdlet New-CSApplicationAccessPolicy. Using the latest version of MicrosoftTeams module din't solve it.

Take a look at my post...

https://techcommunity.microsoft.com/t5/teams-developer/error-creating-application-access-policy/m-p/...
1 best response

Accepted Solutions
best response confirmed by Little_Joe (Bronze Contributor)
Solution
That's a known issue with the new Teams module. It is supposed to create a remote PowerShell session to the SfBO backend the first time you try to execute a *cs* cmdlet, yet this often fails. Reconnecting/reloading the module/opening new PowerShell console eventually works, but it's not consistent.

View solution in original post