Micke-K / IntuneManagement

Copy, export, import, delete, document and compare policies and profiles in Intune and Azure with PowerShell script and WPF UI. Import ADMX files and registry settings with ADMX ingestion. View and edit PowerShell script.
MIT License
1.14k stars 201 forks source link

An error was generated when getting current user:Failed to invoke MS Graph #95

Closed chuanrou closed 1 year ago

chuanrou commented 2 years ago

Get current user Failed to invoke MS Graph with URL https://graph.microsoft.com/beta/ME (Request ID: 3b122e61-a1a4-4eed-a406-88abdd02c826). Status code:

Micke-K commented 2 years ago

Hello!

What was the status code? I can't troubleshoot without that :)

Cheers

chuanrou commented 2 years ago

Status code: is null !

Thanks !

chuanrou commented 2 years ago

Initiate consent prompt Consent prompt for the following scopes: Agreement.ReadWrite.All,Organization.ReadWrite.All Consent for additional scopes added successfully Get tennant list Failed to login. Error: invalid_grant. Description: AADSTS65001: The user or administrator has not consented to use the application with ID 'd1ddf0e4-d672-4dae-b554-9d5bdfd93547' named 'Microsoft Intune PowerShell'. Send an interactive authorization request for this user and resource. Trace ID: 7468b22c-e13b-4585-9b81-b2d642a77300 Correlation ID: 86835ca2-7f8c-4913-874b-bc311ad4358b Timestamp: 2022-10-20 14:55:18Z Get current user Failed to invoke MS Graph with URL https://graph.microsoft.com/beta/ME (Request ID: 66f279d3-3889-463e-a20b-8aa063c01b5f). Status code: Get organization info Failed to invoke MS Graph with URL https://graph.microsoft.com/beta/Organization (Request ID: baad312c-7383-4589-a4ea-dfa32af764e0). Status code: Trigger function Invoke-GraphAuthenticationUpdated Trigger Invoke-GraphAuthenticationUpdated in EndpointManager Trigger Invoke-GraphAuthenticationUpdated in MSGraph Clear cached values Loading Administrative Templates objects ???@????.tw authenticated successfully (Silent). CorrelationId: 5314767d-f1e7-4a06-b65b-040d993e5f45 Failed to invoke MS Graph with URL https://graph.microsoft.com/beta/deviceManagement/groupPolicyConfigurations (Request ID: 4f1a0d0c-533b-428f-ad1f-acdeddc00c1c). Status code:

Micke-K commented 2 years ago

Looks like the Azure App "Microsoft Intune PowerShell" is not approved for the organisation. You might not have the permissions to approve it so the script fails to authenticate. Can you use the Microsoft Intune PowerShell PowerShell module? That uses the same Azure app.

Cheers!

What permission do you have in Azure? Can you use

Micke-K commented 1 year ago

Hello!

Do you have any update on this or can I close the issue?

Cheers!

Micke-K commented 1 year ago

Closing issue. Let me know if you still have any problems with this.

Cheers!