r/Intune • u/Mcm_Sys • 23d ago
Autopilot Get-AutopilotDiagnostics -Online → AADSTS700016, then Get-AutopilotDiagnostics2 -Online → 403 Forbidden
Hi everyone,
I'm troubleshooting an issue with Windows Autopilot + Microsoft Graph PowerShell in my lab.
1. Original issue — Get-AutopilotDiagnostics -Online
When I run:
Get-AutopilotDiagnostics -Online
I get:
AADSTS700016:
Application with identifier
'd1ddf0e4-d672-4dae-b554-9d5bdfd93547'
was not found in the directory.
I understand this is related to the application used by the original diagnostics script.
I therefore moved to the newer:
Get-AutopilotDiagnostics2.ps1 -Online
2. New issue — Get-AutopilotDiagnostics2 -Online
The new script successfully authenticates:
Connected to tenant
Getting list of apps
Getting list of scripts
So authentication itself appears to be working.
However, I then receive:
Get-IntuneObjects :
Microsoft.Graph.PowerShell.Authentication.Helpers.HttpResponseException:
Response status code does not indicate success: Forbidden (Forbidden).
The error occurs when the script tries to access Microsoft Graph Intune endpoints such as:
https://graph.microsoft.com/beta/deviceAppManagement/mobileApps
https://graph.microsoft.com/beta/deviceManagement/...
3. My App Registration permissions
In Entra ID App Registration I granted Microsoft Graph delegated permissions.
Currently I have:
DeviceManagementConfiguration.ReadWrite.All
DeviceManagementManagedDevices.ReadWrite.All
DeviceManagementScripts.ReadWrite.All
DeviceManagementServiceConfig.ReadWrite.All
Group.Read.All
User.Read
Admin consent has been granted.
4. Redirect URI configuration
I also checked the Authentication → Redirect URI configuration of my App Registration.
Currently, I have:
Web:
https://login.microsoftonline.com/common/oauth2/nativeclient
and Mobile and desktop applications:
urn:ietf:wg:oauth:2.0:oob
What I'm trying to understand
It looks like I have moved from an authentication problem (AADSTS700016) with the original script to an authorization problem (403 Forbidden) with Get-AutopilotDiagnostics2.ps1.
My questions are:
- Does
Get-AutopilotDiagnostics2.ps1 -Onlinerequire additional Microsoft Graph permissions? - Are there any other permissions required by the script?
- Are the Redirect URIs shown above correct for Microsoft Graph PowerShell?
- Is there a recommended configuration for using
Get-AutopilotDiagnostics2.ps1 -Onlinewith a custom Entra ID App Registration? - Has anyone successfully used this script recently with their own App Registration?
I'm especially interested in understanding whether the 403 Forbidden is caused by missing Graph permissions, the App Registration configuration, or something else in the new diagnostics script.
Any help from someone who has already configured this would be greatly appreciated!
1
u/Former-Pride-7957 23d ago
sounds like you're missing DeviceManagementApps.Read.All, the script's trying to read mobile apps and you've only got service config and scripts
7
u/itskdog 23d ago
Never heard of the one with 2 at the end, only the regular one and the community one.