SOLVED
Home

Connect-MicrosoftTeams Error

%3CLINGO-SUB%20id%3D%22lingo-sub-176193%22%20slang%3D%22en-US%22%3EConnect-MicrosoftTeams%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-176193%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EI%20am%20getting%20the%20below%20errors%20while%20running%20the%20connect-microsoftteams%20command%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPS%20C%3A%5CProgram%20Files%5CPowerShell%5C6.1.0-preview.1%26gt%3B%20connect-microsoftteams%20-Credenti%3CBR%20%2F%3Eal%20%24cred%3CBR%20%2F%3Econnect-microsoftteams%20%3A%20One%20or%20more%20errors%20occurred.%20(Could%20not%20load%20type%20'Syst%3CBR%20%2F%3Eem.Security.Cryptography.SHA256Cng'%20from%20assembly%20'System.Core%2C%20Version%3D4.0.0.0%2C%3CBR%20%2F%3E%20Culture%3Dneutral%2C%20PublicKeyToken%3Db77a5c561934e089'.)%3A%20Could%20not%20load%20type%20'Syste%3CBR%20%2F%3Em.Security.Cryptography.SHA256Cng'%20from%20assembly%20'System.Core%2C%20Version%3D4.0.0.0%2C%3CBR%20%2F%3ECulture%3Dneutral%2C%20PublicKeyToken%3Db77a5c561934e089'.%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20connect-microsoftteams%20-Credential%20%24cred%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20AuthenticationError%3A%20(%3A)%20%5BConnect-MicrosoftTeams%5D%2C%20Aad%3CBR%20%2F%3EAuthenticationFailedException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20Connect-MicrosoftTeams%2CMicrosoft.Open.Teams.CommonLibr%3CBR%20%2F%3Eary.ConnectMicrosoftTeams%3C%2FP%3E%0A%3CP%3Econnect-microsoftteams%20%3A%20One%20or%20more%20errors%20occurred.%20(Could%20not%20load%20type%20'Syst%3CBR%20%2F%3Eem.Security.Cryptography.SHA256Cng'%20from%20assembly%20'System.Core%2C%20Version%3D4.0.0.0%2C%3CBR%20%2F%3E%20Culture%3Dneutral%2C%20PublicKeyToken%3Db77a5c561934e089'.)%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20connect-microsoftteams%20-Credential%20%24cred%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20AuthenticationError%3A%20(%3A)%20%5BConnect-MicrosoftTeams%5D%2C%20Agg%3CBR%20%2F%3EregateException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20Connect-MicrosoftTeams%2CMicrosoft.Open.Teams.CommonLibr%3CBR%20%2F%3Eary.ConnectMicrosoftTeams%3C%2FP%3E%0A%3CP%3Econnect-microsoftteams%20%3A%20Could%20not%20load%20type%20'System.Security.Cryptography.SHA25%3CBR%20%2F%3E6Cng'%20from%20assembly%20'System.Core%2C%20Version%3D4.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyTok%3CBR%20%2F%3Een%3Db77a5c561934e089'.%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20connect-microsoftteams%20-Credential%20%24cred%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20AuthenticationError%3A%20(%3A)%20%5BConnect-MicrosoftTeams%5D%2C%20Typ%3CBR%20%2F%3EeLoadException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20Connect-MicrosoftTeams%2CMicrosoft.Open.Teams.CommonLibr%3CBR%20%2F%3Eary.ConnectMicrosoftTeams%3C%2FP%3E%0A%3CP%3Econnect-microsoftteams%20%3A%20One%20or%20more%20errors%20occurred.%20(Could%20not%20load%20type%20'Syst%3CBR%20%2F%3Eem.Security.Cryptography.SHA256Cng'%20from%20assembly%20'System.Core%2C%20Version%3D4.0.0.0%2C%3CBR%20%2F%3E%20Culture%3Dneutral%2C%20PublicKeyToken%3Db77a5c561934e089'.)%3A%20Could%20not%20load%20type%20'Syste%3CBR%20%2F%3Em.Security.Cryptography.SHA256Cng'%20from%20assembly%20'System.Core%2C%20Version%3D4.0.0.0%2C%3CBR%20%2F%3ECulture%3Dneutral%2C%20PublicKeyToken%3Db77a5c561934e089'.%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20connect-microsoftteams%20-Credential%20%24cred%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20NotSpecified%3A%20(%3A)%20%5BConnect-MicrosoftTeams%5D%2C%20AadAuthent%3CBR%20%2F%3EicationFailedException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20Microsoft.Open.Teams.CommonLibrary.AadAuthenticationFa%3CBR%20%2F%3EiledException%2CMicrosoft.Open.Teams.CommonLibrary.ConnectMicrosoftTeams%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-176804%22%20slang%3D%22en-US%22%3ERe%3A%20Connect-MicrosoftTeams%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-176804%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20Paul%20for%20your%20response.%20Issue%20has%20been%20resolved.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-176232%22%20slang%3D%22en-US%22%3ERe%3A%20Connect-MicrosoftTeams%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-176232%22%20slang%3D%22en-US%22%3E%3CP%3ESeems%20to%20me%20you%20are%20using%20mfa%20so%20you%20should%20use%20weblogin%20in%20your%20connect%20statement%3C%2FP%3E%3C%2FLINGO-BODY%3E
Pankaj Kumar
Occasional Contributor

Hi,

I am getting the below errors while running the connect-microsoftteams command

 

PS C:\Program Files\PowerShell\6.1.0-preview.1> connect-microsoftteams -Credenti
al $cred
connect-microsoftteams : One or more errors occurred. (Could not load type 'Syst
em.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'.): Could not load type 'Syste
m.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'.
At line:1 char:1
+ connect-microsoftteams -Credential $cred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : AuthenticationError: (:) [Connect-MicrosoftTeams], Aad
AuthenticationFailedException
+ FullyQualifiedErrorId : Connect-MicrosoftTeams,Microsoft.Open.Teams.CommonLibr
ary.ConnectMicrosoftTeams

connect-microsoftteams : One or more errors occurred. (Could not load type 'Syst
em.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'.)
At line:1 char:1
+ connect-microsoftteams -Credential $cred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : AuthenticationError: (:) [Connect-MicrosoftTeams], Agg
regateException
+ FullyQualifiedErrorId : Connect-MicrosoftTeams,Microsoft.Open.Teams.CommonLibr
ary.ConnectMicrosoftTeams

connect-microsoftteams : Could not load type 'System.Security.Cryptography.SHA25
6Cng' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyTok
en=b77a5c561934e089'.
At line:1 char:1
+ connect-microsoftteams -Credential $cred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : AuthenticationError: (:) [Connect-MicrosoftTeams], Typ
eLoadException
+ FullyQualifiedErrorId : Connect-MicrosoftTeams,Microsoft.Open.Teams.CommonLibr
ary.ConnectMicrosoftTeams

connect-microsoftteams : One or more errors occurred. (Could not load type 'Syst
em.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'.): Could not load type 'Syste
m.Security.Cryptography.SHA256Cng' from assembly 'System.Core, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'.
At line:1 char:1
+ connect-microsoftteams -Credential $cred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-MicrosoftTeams], AadAuthent
icationFailedException
+ FullyQualifiedErrorId : Microsoft.Open.Teams.CommonLibrary.AadAuthenticationFa
iledException,Microsoft.Open.Teams.CommonLibrary.ConnectMicrosoftTeams

2 Replies
Solution

Seems to me you are using mfa so you should use weblogin in your connect statement

Thanks Paul for your response. Issue has been resolved.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
35 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
9 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies