MicrosoftTeams PowerShell cmdlet doesn't work

%3CLINGO-SUB%20id%3D%22lingo-sub-1375257%22%20slang%3D%22en-US%22%3EMicrosoftTeams%20PowerShell%20cmdlet%20doesn't%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1375257%22%20slang%3D%22en-US%22%3E%3CP%3EExcuse%20me%2C%3C%2FP%3E%3CP%3E%3CFONT%3EMicrosoft%20Teams%20PowerShell%20cmdlet%20doesn't%20work.%20The%20error%20is%3A%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EConnect-MicrosoftTeams%20%3A%20The%20term%20'Connect-MicrosoftTeams'%20is%20not%20recognized%20as%20the%20name%20of%20a%20cmdlet%2C%20function%2C%20script%20file%2C%20or%20operable%20program.%20Check%20the%20spelling%20of%20the%20name%2C%20or%20if%20a%20path%20was%20included%2C%20verify%20that%20the%20path%20is%20correct%20and%20try%20again.%0AAt%20line%3A1%20char%3A1%0A%2B%20Connect-MicrosoftTeams%20%2B%20~~~~~~~~~~~~~~~~~~~~~~%0A%20%20%2B%20CategoryInfo%20%3A%20ObjectNotFound%3A%20(Connect-MicrosoftTeams%3AString)%20%5B%5D%2C%20CommandNotFoundException%0A%20%20%2B%20FullyQualifiedErrorId%20%3A%20CommandNotFoundException%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%3EI've%20installed%20the%20module%20and%20import%20it%20properly.%20Any%20idea%3F%20Thanks!%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PowerShell-MS_Teams-2020-05-09_024131.png%22%20style%3D%22width%3A%20952px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F190241i5AB50FD82DD80BDD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22PowerShell-MS_Teams-2020-05-09_024131.png%22%20alt%3D%22PowerShell-MS_Teams-2020-05-09_024131.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1375257%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-1375548%22%20slang%3D%22en-US%22%3ERe%3A%20MicrosoftTeams%20PowerShell%20cmdlet%20doesn't%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1375548%22%20slang%3D%22en-US%22%3EHi%20Peter%2C%3CBR%20%2F%3E%3CBR%20%2F%3EWhat%20is%20the%20version%20of%20PowerShell%3F%3CBR%20%2F%3ECan%20you%20validate%20that%20you%20are%20using%20PowerShell%205.1%20or%20later%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1376851%22%20slang%3D%22en-US%22%3ERe%3A%20MicrosoftTeams%20PowerShell%20cmdlet%20doesn't%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1376851%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239281%22%20target%3D%22_blank%22%3E%40Mitchell%20Bakker%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EThank%20you!%20I%20also%20contacted%20Office365%20support%20and%20the%20agent%20show%20me%20the%20correct%20and%20updated%20command%20lines%20to%20run%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EPS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20%24credentials%3DGet-Credential%0A%0Acmdlet%20Get-Credential%20at%20command%20pipeline%20position%201%0ASupply%20values%20for%20the%20following%20parameters%3A%0ACredential%0APS%20C%3A%5CWINDOWS%5Csystem32%26gt%3B%20Connect-MicrosoftTeams%20-Credential%20%24credentials%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EShame%20that%20Microsoft%20Teams%20PowerShell%20cmdlet%20documentation%20was%20not%20updated%20or%20friendly%20to%20a%201st-time%2Fnew%20user%20like%20me.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1376881%22%20slang%3D%22en-US%22%3ERe%3A%20MicrosoftTeams%20PowerShell%20cmdlet%20doesn't%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1376881%22%20slang%3D%22en-US%22%3ESo%2C%20your%20problem%20is%20fixed%20now%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1389482%22%20slang%3D%22en-US%22%3ERe%3A%20MicrosoftTeams%20PowerShell%20cmdlet%20doesn't%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1389482%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239281%22%20target%3D%22_blank%22%3E%40Mitchell%20Bakker%3C%2FA%3E%26nbsp%3BYes%2C%20thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1631322%22%20slang%3D%22en-US%22%3ERe%3A%20MicrosoftTeams%20PowerShell%20cmdlet%20doesn't%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1631322%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239281%22%20target%3D%22_blank%22%3E%40Mitchell%20Bakker%3C%2FA%3E%20unfortunatley%20peter-wxin%20solution%20didnt%20worked%20for%20me.%20My%20Powershell%20version%20is%205.1.19041.1%3CBR%20%2F%3EAfter%20providing%20credentials%20and%20running%20the%20cmd%20%22Connect-MicrosoftTeams%20-Credential%20%24credentials%22%20it's%20still%20throwing%20the%20same%20error.%3CBR%20%2F%3E%3CBR%20%2F%3EMicrosoft%20Teams%20cmdlets%20module%20version%20installed%20is%201.1.4%3C%2FP%3E%3CP%3EPlease%20help%3C%2FP%3E%3CP%3EKind%20Regards%3C%2FP%3E%3CP%3EAlan%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Excuse me,

Microsoft Teams PowerShell cmdlet doesn't work. The error is:

 

Connect-MicrosoftTeams : The term 'Connect-MicrosoftTeams' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Connect-MicrosoftTeams + ~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo : ObjectNotFound: (Connect-MicrosoftTeams:String) [], CommandNotFoundException
  + FullyQualifiedErrorId : CommandNotFoundException

 

I've installed the module and import it properly. Any idea? Thanks!

PowerShell-MS_Teams-2020-05-09_024131.png

5 Replies
Highlighted
Hi Peter,

What is the version of PowerShell?
Can you validate that you are using PowerShell 5.1 or later?
Highlighted

Hi, @Mitchell Bakker,

Thank you! I also contacted Office365 support and the agent show me the correct and updated command lines to run:

 

PS C:\WINDOWS\system32> $credentials=Get-Credential

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
PS C:\WINDOWS\system32> Connect-MicrosoftTeams -Credential $credentials

 

Shame that Microsoft Teams PowerShell cmdlet documentation was not updated or friendly to a 1st-time/new user like me.

Highlighted
So, your problem is fixed now?
Highlighted
Highlighted

Hi @Mitchell Bakker unfortunatley peter-wxin solution didnt worked for me. My Powershell version is 5.1.19041.1
After providing credentials and running the cmd "Connect-MicrosoftTeams -Credential $credentials" it's still throwing the same error.

Microsoft Teams cmdlets module version installed is 1.1.4

Please help

Kind Regards

Alan