SOLVED

Cannot perform any actions after entered Connect-MicrosoftTeams cmdlet

%3CLINGO-SUB%20id%3D%22lingo-sub-2654458%22%20slang%3D%22en-US%22%3ECannot%20perform%20any%20actions%20after%20entered%20Connect-MicrosoftTeams%20cmdlet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2654458%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20guys%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20encountered%20this%20issue%20recently%3F%20When%20I%20was%20entered%20the%20cmdlet%20with%20Connect-MicrosoftTeams%20and%20authenticated%20successfully%20in%20the%20PS%20window%2C%20I%20run%20other%20Teams%20PS%20cmdlets%20it%20just%20says%20%22Run%20Connect-MicrosoftTeams%20before%20running%20cmdlets%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESince%20my%20account%20was%20enabled%20with%20MFA%20and%20I%20was%20using%20this%20method%20without%20any%20issue%20before...%3C%2FP%3E%3CP%3ESee%20below%20screenshot%20for%20your%20reference.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22MicrosoftTeams-image%20(18).png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F303647iA22245ABC8A35520%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22MicrosoftTeams-image%20(18).png%22%20alt%3D%22MicrosoftTeams-image%20(18).png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2654458%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2654876%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20perform%20any%20actions%20after%20entered%20Connect-MicrosoftTeams%20cmdlet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2654876%22%20slang%3D%22en-US%22%3EThat's%20a%20known%20issue%20with%20the%20new%20Teams%20module.%20It%20is%20supposed%20to%20create%20a%20remote%20PowerShell%20session%20to%20the%20SfBO%20backend%20the%20first%20time%20you%20try%20to%20execute%20a%20*cs*%20cmdlet%2C%20yet%20this%20often%20fails.%20Reconnecting%2Freloading%20the%20module%2Fopening%20new%20PowerShell%20console%20eventually%20works%2C%20but%20it's%20not%20consistent.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2654877%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20perform%20any%20actions%20after%20entered%20Connect-MicrosoftTeams%20cmdlet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2654877%22%20slang%3D%22en-US%22%3EHi%20Vasil%2C%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20the%20reply.%3CBR%20%2F%3E%3CBR%20%2F%3EYes%2C%20I%20found%20the%20issue%20is%20probably%20related%20to%20the%20Teams%20PowerShell%20Module%20version%202.5.0.%20When%20I%20try%20with%202.3.1%20it%20is%20working!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2660465%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20perform%20any%20actions%20after%20entered%20Connect-MicrosoftTeams%20cmdlet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2660465%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20screen%20shot%20looks%20as%20if%20it's%20reporting%20an%20error%20with%202.3.1.%20A%20change%20to%20Connect-MicrosoftTeams%20is%20in%202.5%20(from%20release%20notes)%3A%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20Access%20Token%20login%20for%20Connect-MicrosoftTeams%20now%20uses%20a%20unified%20token%20array%20instead%20of%20separate%20parameters%20for%20each%20resource%20access%20token.%20See%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fteams%2Fconnect-microsoftteams%3Fview%3Dteams-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fteams%2Fconnect-microsoftteams%3Fview%3Dteams-ps%3C%2FA%3E%20for%20more%20details.%3CBR%20%2F%3E%3CBR%20%2F%3EWhat%20kind%20of%20connection%20were%20you%20trying%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2700837%22%20slang%3D%22en-US%22%3ERe%3A%20Cannot%20perform%20any%20actions%20after%20entered%20Connect-MicrosoftTeams%20cmdlet%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2700837%22%20slang%3D%22en-US%22%3EI'm%20experiencing%20the%20same%20problem%20when%20I%20run%20the%20cmdlet%20New-CSApplicationAccessPolicy.%20Using%20the%20latest%20version%20of%20MicrosoftTeams%20module%20din't%20solve%20it.%3CBR%20%2F%3E%3CBR%20%2F%3ETake%20a%20look%20at%20my%20post...%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fteams-developer%2Ferror-creating-application-access-policy%2Fm-p%2F2700347%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fteams-developer%2Ferror-creating-application-access-policy%2Fm-p%2F2700347%3C%2FA%3E%3C%2FLINGO-BODY%3E
Regular 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 (Regular 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://gorovian.000webhostapp.com/?exam=t5/teams-developer/error-creating-application-access-policy/m-p/...
www.000webhost.com