Error:
Result code: -4 System.Management.Automation.RuntimeException: Job Timeout - Server Job is not yet complete, waited '00:30:00'
AutopilotCleanUp.log:
Output generated on: 2024-07-20T14:35:07.7080036+01:00
Message: CreateJob -Mode FindOrCreate
Message: JobId: 57
Message: Status: Retrying
Message: RunAfter: 07/20/2024 13:24:06
Message: StatusText: API exception encountered in 'GetGraphAuthInfo' [StatusCode=InternalServerError, Method=GET].; retrying in 00:08:00
Message: Sleeping until RunAfter for '537.3443668' seconds...
Message: GetJob RemoveWindowsAutoPilotDeviceIdentity
Message: JobId: 57
Message: Status: Retrying
Message: RunAfter: 07/20/2024 13:33:07
Message: StatusText: API exception encountered in 'GetGraphAuthInfo' [StatusCode=InternalServerError, Method=GET].; retrying in 00:09:00
Message: Sleeping until RunAfter for '540.6536159' seconds...
Message: GetJob RemoveWindowsAutoPilotDeviceIdentity
Message: JobId: 57
Message: Status: Failed
Message: StatusText: Reached error limit of 10
Message: Reached error limit of 10
Result code: 1
Result: Failed
or
IsJobRunning: Retrying
System.Management.Automation.RuntimeException: Job Timeout - Server Job is not yet complete, waited '00:30:00'
API exception encountered in 'GetGraphAuthInfo' [StatusCode=InternalServerError, Method=GET].; retrying in 00:08:00
CreateJob -Mode FindOrCreate
Job:
JobId: 63
Status: Retrying
RunAfter: 07/22/2024 11:35:56
StatusText: API exception encountered in 'GetGraphAuthInfo' [StatusCode=InternalServerError, Method=GET].; retrying in 00:08:00
EndpointId: 5130
DeviceJobId: 1789487
JobType: RemoveWindowsAutoPilotDeviceIdentity
IsCanceled: False
ErrorCount: 8
Created: 07/22/2024 10:55:47
Modified: 07/22/2024 11:27:56
Started: 07/22/2024 10:56:53
Completed:
Permissions needed regranting - reconnect tenants
If the issue remains after reconnecting the tenant, this could be due to Microsoft Replication Delay.
We have confirmed that this behavior is expected as part of the Auto-pilot cleanup feature. There can be replication delays when the Auto-pilot hash is being removed in Intune — in some cases, it may take several hours after the removal command is issued. The code is designed to time out after a certain period, requiring the job to be resubmitted.
This degradation or delay occurs within Intune/Entra and can even be reproduced manually when removing the hash directly from the UI.
We recommend running these types of jobs ahead of the migration cutover window to allow sufficient time for the removal process in case delays occur.
By default there is 30min (1800sec) CheckStatusTimeoutSeconds limit - this can be adjusted in the code based on customer needs, however, this will be considered as customization and PSO (Professional Services) will be required.
In summary, the logic issues a Graph API call to remove the record and then waits for confirmation of the deletion. If the record is not removed after a prolonged period, the job fails and can be resubmitted manually later.
To move forward in case of this failure is either to work with PSO and adjust the code based on needs or set the status for Autopilot Cleanup to Completed manually if the record has been removed in Autopilot portal.