Getting error using Connect-MgGraph in PowerShell after running update-module

Kathy Blasco 101 Reputation points
2021-04-23T20:11:34.34+00:00

I updated my modules in PowerShell on 4/22/2021 and now when I try to execute:

Connect-MgGraph -ClientID HIDDEN -TenantId HIDDEN -CertificateThumbprint HIDDEN 

I am getting the following error:

Connect-MgGraph : Could not load type 'System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler' from assembly 'System.IdentityModel.Tokens.Jwt,
Version=4.0.20622.1351, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
At line:1 char:1

  • Connect-MgGraph -ClientID $env:PnPClientId -TenantId $env:PnPTenantId ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : NotSpecified: (:) [Connect-MgGraph], TypeLoadException
  • FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Authentication.Cmdlets.ConnectMgGraph

Executing the connect statement prior to executing update-module, connected successfully.

microsoft.graph.authentication is now version 1.5.0

Does anyone have suggestions on how to fix this error so I can connect?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,592 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,364 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,731 Reputation points Microsoft Vendor
    2021-04-26T03:43:08.733+00:00

    Hi,

    Please help to report the issue over here
    https://github.com/microsoftgraph/msgraph-sdk-powershell/issues

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful