SOLVED

Connect-MicrosoftTeams Error

Copper 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
best response confirmed by VI_Migration (Silver Contributor)
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.

1 best response

Accepted Solutions
best response confirmed by VI_Migration (Silver Contributor)
Solution

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

View solution in original post