microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Graph-MgConnect error: Entry point was not found. Powershell 7.5.0

Offen
#3,133 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feedback Needs: Attention :wave: type:bug
Vorherrschende Sprache
C#
Sterne
898
Forks
230
Ø Merge
2 T. 5 Std.
Gemergte PRs (30 T.)
31

Beschreibung

Describe the bug

I have a strange behavior using graph api. If i run a script through Visual Studio Code and Powershell extantion all works well but if i schedule the same script with task scheduler i get the entry point not found error.
I'm using powershell 7.5.0 for both Visual Studio Code and task scheduler execution. I have a lot of script run with task scheduler and all have the same issue.
As installed module i have only Graph module, MSAL.PS and SimplySql

This is the action configured on task scheduler:
Program/script: "C:\Program Files\PowerShell\7\pwsh.exe"
Add Arguments: -ExecutionPolicy Bypass -File "C:\script\test.ps1"

The execution policy is set to RemoteSign for both LocalMachine and CurrentUser

Expected behavior

If script execution works in visual studio code than it should also work with task scheduler

How to reproduce

schedule script with task scheduler

SDK Version

2.25.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```

PowerShell transcript start
Start time: 20250214192336
Username: CORPABSTR....
RunAs User: CORPABSTR....
Configuration Name:
Machine: ABS-DC2 (Microsoft Windows NT 10.0.14393.0)
Host Application: C:\Program Files\PowerShell\7\pwsh.dll -ExecutionPolicy Bypass -File C:\script\RenewConsultants\RenewConsultants.ps1
Process ID: 7048
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, 5.0, 5.1, 6.0, 7.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
WSManStackVersion: 3.0


Transcript started, output file is C:\script\RenewConsultants\logs\transcript.txt
DEBUG: ClientCertificateCredential.GetToken invoked. Scopes: [ https://graph.microsoft.com/.default ] ParentRequestId:
DEBUG: False MSAL 4.66.1.0 MSAL.NetCore .NET 9.0.1 Microsoft Windows 10.0.14393 [2025-02-14 18:23:36Z - 922e791c-3626-46c6-ae91-aaadc725a01d] MSAL MSAL.NetCore with assembly version '4.66.1.0'. CorrelationId(922e791c-3626-46c6-ae91-aaadc725a01d)
DEBUG: False MSAL 4.66.1.0 MSAL.NetCore .NET 9.0.1 Microsoft Windows 10.0.14393 [2025-02-14 18:23:36Z - 922e791c-3626-46c6-ae91-aaadc725a01d] === AcquireTokenForClientParameters ===
SendX5C: False
ForceRefresh: False
DEBUG: False MSAL 4.66.1.0 MSAL.NetCore .NET 9.0.1 Microsoft Windows 10.0.14393 [2025-02-14 18:23:36Z - 922e791c-3626-46c6-ae91-aaadc725a01d]
=== 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 - 922e791c-3626-46c6-ae91-aaadc725a01d
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-14 18:23:36Z - 922e791c-3626-46c6-ae91-aaadc725a01d] === 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-14 18:23:36Z] [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-14 18:23:36Z - 922e791c-3626-46c6-ae91-aaadc725a01d] [Internal cache] Total number of cache partitions found while getting access tokens: 0
DEBUG: False MSAL 4.66.1.0 MSAL.NetCore .NET 9.0.1 Microsoft Windows 10.0.14393 [2025-02-14 18:23:36Z - 922e791c-3626-46c6-ae91-aaadc725a01d] [FindAccessTokenAsync] Discovered 0 access tokens in cache using partition key: d18e5660-6c3a-4084-8952-8ecc666c5592_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-14 18:23:36Z - 922e791c-3626-46c6-ae91-aaadc725a01d] [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-14 18:23:36Z - 922e791c-3626-46c6-ae91-aaadc725a01d] [Region discovery] Not using a regional authority.
DEBUG: False MSAL 4.66.1.0 MSAL.NetCore .NET 9.0.1 Microsoft Windows 10.0.14393 [2025-02-14 18:23:36Z - 922e791c-3626-46c6-ae91-aaadc725a01d] Fetching instance discovery from the network from host login.microsoftonline.com.
DEBUG: Request [2a3c206e-8648-4401-815c-61718aa5c0f1] GET https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=REDACTED
x-client-SKU:REDACTED
x-client-Ver:REDACTED
x-client-OS:REDACTED
client-request-id:REDACTED
return-client-request-id:REDACTED
x-ms-client-request-id:2a3c206e-8648-4401-815c-61718aa5c0f1
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
Connect-MgGraph: C:\script\RenewConsultants\RenewConsultants.ps1:731
Line |
731 | Connect-MgGraph -ClientID $microsoftGraph.appID -TenantId $micros …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Entry point was not found.
Connect-MgGraph: C:\script\RenewConsultants\RenewConsultants.ps1:731
Line |
731 | Connect-MgGraph -ClientID $microsoftGraph.appID -TenantId $micros …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Entry point was not found.


PowerShell transcript end
End time: 20250214192337


</details>


### Configuration

$PSVersionTable output:
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

OS Version:
Edition: Windows Server 2016
Version: 1607
OS Build: 14393.7785

Architecture:
x64

### Other information

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie damit, Connect-MgGraph aus C:\script\RenewConsultants\RenewConsultants.ps1, Zeile 731, unter Task Scheduler erneut auszuführen und mit der Ausführung in Visual Studio Code zu vergleichen. Untersuchen Sie das Verhalten beim Laden der Abhängigkeiten von Graph SDK 2.25.0 und MSAL unter PowerShell 7.5.0 und Windows Server 2016. Als erledigt gilt die Identifizierung der Ursache des fehlenden Einstiegspunkts sowie die Bereitstellung einer verifizierten Lösung oder von Kompatibilitätshinweisen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
powershell
Bereich
api, cli
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.