Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Connect-MgGraph with powershell 7.5.0 show error: Entry point not found #5162

Open
alessandroere opened this issue Feb 27, 2025 · 3 comments

Comments

@alessandroere
Copy link

Library version used

4.8.03761

.NET version

Hi,
i have a powershell script that use Microsoft Graph SDK to connect to Microsoft 365.
When i run the script i get Entry Point not found from command Connect-MGGraph. I suppose that the problem is the MSAL but i don't know how to fix the error.
Here the debug output for command Connect-MgGraph
`=== Request Data ===
Authority Provided? - True
Scopes - https://graph.microsoft.com/.default
Extra Query Params Keys (space separated) -
ApiId - AcquireTokenForClient
IsConfidentialClient - True
SendX5C - False
LoginHint ? False
IsBrokerConfigured - False
HomeAccountId - False
CorrelationId - ec340abd-ef5b-4386-bd88-6d9dc9faebb9
UserAssertion set: False
LongRunningOboCacheKey set: False
Region configured:

DEBUG: False MSAL 4.66.1.0 MSAL.NetCore .NET 9.0.1 Microsoft Windows 10.0.14393 [2025-02-27 22:59:22Z - ec340abd-ef5b-4386-bd88-6d9dc9faebb9] === Token Acquisition (ClientCredentialRequest) started:
Scopes: https://graph.microsoft.com/.default
Authority Host: login.microsoftonline.com
DEBUG: False MSAL 4.66.1.0 MSAL.NetCore .NET 9.0.1 Microsoft Windows 10.0.14393 [2025-02-27 22:59:22Z] [Internal cache] Clearing app token cache accessor.
DEBUG: False MSAL 4.66.1.0 MSAL.NetCore .NET 9.0.1 Microsoft Windows 10.0.14393 [2025-02-27 22:59:22Z - ec340abd-ef5b-4386-bd88-6d9dc9faebb9] [Internal cache] Total number of cache partitions found whil
e getting access tokens: 0
DEBUG: False MSAL 4.66.1.0 MSAL.NetCore .NET 9.0.1 Microsoft Windows 10.0.14393 [2025-02-27 22:59:22Z - ec340abd-ef5b-4386-bd88-6d9dc9faebb9] [FindAccessTokenAsync] Discovered 0 access tokens in cache u
sing partition key: 5ae2aca2-138a-44e7-862a-1d6fe9c9b959_5f4c80c0-58ee-4e80-8990-b80e85ad9e5b_AppTokenCache
DEBUG: False MSAL 4.66.1.0 MSAL.NetCore .NET 9.0.1 Microsoft Windows 10.0.14393 [2025-02-27 22:59:22Z - ec340abd-ef5b-4386-bd88-6d9dc9faebb9] [Instance Discovery] Instance discovery is enabled and will
be performed
DEBUG: False MSAL 4.66.1.0 MSAL.NetCore .NET 9.0.1 Microsoft Windows 10.0.14393 [2025-02-27 22:59:22Z - ec340abd-ef5b-4386-bd88-6d9dc9faebb9] [Region discovery] Not using a regional authority.
DEBUG: Request [32fe00f0-76e8-43e6-859e-06fb275ce002] POST https://login.microsoftonline.com/5f4c80c0-58ee-4e80-8990-b80e85ad9e5b/oauth2/v2.0/token
x-client-SKU:REDACTED
x-client-Ver:REDACTED
x-client-OS:REDACTED
x-client-current-telemetry:REDACTED
x-ms-PKeyAuth:REDACTED
x-ms-lib-capability:REDACTED
client-request-id:REDACTED
return-client-request-id:REDACTED
Content-Type:application/x-www-form-urlencoded
x-ms-client-request-id:32fe00f0-76e8-43e6-859e-06fb275ce002
x-ms-return-client-request-id:true
User-Agent:azsdk-net-Identity/1.13.1 (.NET 9.0.1; Microsoft Windows 10.0.14393)
client assembly: Azure.Identity`

Someone can help me to understand this problem

I create a fresh installation of Windows server 2016 but i always got the same problem

I notice that when in the debug output show that it's using the MSAL version 4.67.2.0 all works. I don't know how to force to use this version

Thank

Scenario

Other - please specify

Is this a new or an existing app?

The app is in production, I haven't upgraded MSAL, but started seeing this issue

Issue description and reproduction steps

On Windows server 2016 with powershell 7.5.0
Execute the command Connect-MgGraph

Relevant code snippets

Expected behavior

Command should connect to microsoft graph APIs

Identity provider

Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)

Regression

4.66.1.0

Solution and workarounds

No response

@alessandroere alessandroere added needs attention Delete label after triage untriaged Do not delete. Needed for Automation labels Feb 27, 2025
@gladjohn gladjohn added question requires more info and removed untriaged Do not delete. Needed for Automation needs attention Delete label after triage labels Feb 28, 2025
@gladjohn
Copy link
Contributor

Can you check which versions of Microsoft.Graph.Authentication and Microsoft.Identity.Client (MSAL) are installed by running:

Get-Module -ListAvailable Microsoft.Graph.Authentication
Get-Module -ListAvailable Microsoft.Identity.Client

What version of PowerShell are you using?

$PSVersionTable

I am not seeing any specific errors in the MSAL logs you shared. how are you switching between MSAL version? Are you updating Microsoft.Graph.Authentication?

little more info on what error you are seeing? and more logs can help us.

@alessandroere
Copy link
Author

alessandroere commented Feb 28, 2025

Hi @gladjohn,
thanks for your time

Powershell version is: 7.5.0

Name                           Value
----                           -----
PSVersion                      7.5.0
PSEdition                      Core
GitCommitId                    7.5.0
OS                             Microsoft Windows 10.0.14393
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

About command: Get-Module -ListAvailable Microsoft.Graph.Authentication this is the output

    Directory: C:\Program Files\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     2.26.1                Microsoft.Graph.Authentication      Core,Desk {Connect-MgGraph, Disconnect-MgGraph, G…

Abount command: Get-Module -ListAvailable Microsoft.Identity.Client
I have no output

This server is a fresh installation of Windows Server 2016 x64. I installed only Powershell 7.5.0 and inside it i installed Microsoft Graph SDK through command Install-Module Microsoft.Graph -Scope AllUsers -Force
After that i installed another powershell module called SimplySql

I don't know why the MSAL version change on debug output. I have never installed MSAL on this server. I suppose is it integrated into the Graph modules or not?

There is a Powershell command that show all MSAL version installed? How to remove all old version and keep the last

@gladjohn
Copy link
Contributor

@alessandroere I would suggest filing an issue here - https://github.com/Azure/azure-powershell/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants