
AnthonyD.33376 (Customer) asked a question.
When we disable/remove a user from AD it marks them as disabled in Okta, but it does not remove their devices so we end up with a considerable amount of devices that are basically orphaned. Is there an automated way to take care of these or do we need to deactivate them manually?

You could leverage Okta Workflows to loop over each device daily and find any that do not have users assigned and delete them. I do not find any Workflow templates already made for this so you would have to create one from scratch.
Step 1: List all devices
https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Device/#tag/Device/operation/listDevices
Step 2: For each device see if they have any users assigned.
[
{...
"_embedded": {
"users": [ ] <<<This is what a device that does not have any users would look like.>>>
}
},...
]
Step 3: If no users get the device ID
[
{
"id": "<<<<<GUID>>>>>",...
Step 4: Delete a device using ID from step 3
https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Device/#tag/Device/operation/deleteDevice