powershell-intune-samples icon indicating copy to clipboard operation
powershell-intune-samples copied to clipboard

Device cannot be deleted - Got a bad request --> "An error has occurred"

Open christiangschmidt opened this issue 3 years ago • 0 comments

Hi!

I have an old device that is still shown in Intune and cannot be deleted there. Deletion from AAD was possible before.

When trying to delete directly by Graph Explorer https://developer.microsoft.com/de-de/graph/graph-explorer I just got a Bad Request error

{ "error": { "code": "BadRequest", "message": "{ "_version": 3, "Message": "An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: 0a5e7a31-1c69-ba0d-e0ac-087bc1ce0264 - Url: https://fef.amsub0502.manage.microsoft.com/DeviceFE/StatelessDeviceFEService/deviceManagement/managedDevices%28%27d4f6c01a-b1d4-4308-b695-f819a5aa9068%27%29?api-version=2021-04-07", "CustomApiErrorPhrase": "", "RetryAfter": null, "ErrorSourceService": "", "HttpHeaders": "{}"}", "innerError": { "date": "2022-06-01T10:22:30", "request-id": "a41135a1-abda-4efd-88e8-9b0fd78b3e79", "client-request-id": "0a5e7a31-1c69-ba0d-e0ac-087bc1ce0264" } } }

Still, the device is present (and visible in Intune) and ca be found by GET https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/d4f6c01a-b1d4-4308-b695-f819a5aa9068

{ "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#deviceManagement/managedDevices/$entity", "id": "d4f6c01a-b1d4-4308-b695-f819a5aa9068", "userId": "00000000-0000-0000-0000-000000000000", "deviceName": "NB04", "managedDeviceOwnerType": "unknown", "enrolledDateTime": "2022-05-28T12:09:48.2315566Z", "lastSyncDateTime": "2022-05-30T06:33:46.2846542Z", "operatingSystem": "Windows", "complianceState": "unknown", "jailBroken": "Unknown", "managementAgent": "msSense", "osVersion": "10.0.19044.1706", "easActivated": false, "easDeviceId": null, "easActivationDateTime": "0001-01-01T00:00:00Z", "azureADRegistered": true, "deviceEnrollmentType": "unknown", "activationLockBypassCode": null, "emailAddress": null, "azureADDeviceId": "a826f632-d297-4173-ac0b-7b35dd67b139", "deviceRegistrationState": "registered", "deviceCategoryDisplayName": "", "isSupervised": false, "exchangeLastSuccessfulSyncDateTime": "0001-01-01T00:00:00Z", "exchangeAccessState": "none", "exchangeAccessStateReason": "none", "remoteAssistanceSessionUrl": "", "remoteAssistanceSessionErrorDetails": "", "isEncrypted": false, "userPrincipalName": null, "model": "HP Pavilion x360 Convertible 15-dq1xxx", "manufacturer": "HP", "imei": null, "complianceGracePeriodExpirationDateTime": "2022-05-28T12:09:55.7095Z", "serialNumber": null, "phoneNumber": null, "androidSecurityPatchLevel": null, "userDisplayName": null, "configurationManagerClientEnabledFeatures": null, "wiFiMacAddress": null, "deviceHealthAttestationState": null, "subscriberCarrier": null, "meid": null, "totalStorageSpaceInBytes": 0, "freeStorageSpaceInBytes": 0, "managedDeviceName": "NB00", "partnerReportedThreatState": "secured", "iccid": "", "udid": "", "notes": null, "ethernetMacAddress": null, "physicalMemoryInBytes": 0, "deviceActionResults": [] }

Any idea how this device can be removed?

Many thanks for your suggestions! Christian

christiangschmidt avatar Jun 01 '22 11:06 christiangschmidt