Removing Disabled Azure AD Users Device

Joseph Dutton 135 Reputation points
2023-06-07T12:59:12.19+00:00

Hey team,

Having a bit of an issue with this one. Removing an Intune device after the user has been disabled in AAD. I understand it is best practice to remove the device prior to removal in AD, but sometimes it happens. There are two main ways that I have seen that are supposed to resolve the issue, both of which I am having problems with.

The first option is https://learn.microsoft.com/en-us/troubleshoot/mem/intune/device-management/orphaned-device-upn-shown-as-none

Here is one solution, but the script seems to be outdated. Having last been updated in GitHub 4 years ago, it seems like some of the PowerShell is inaccurate now. Is there an updated script somewhere, or any thoughts on this?

The second option is the Invoke-IntuneManagedDeviceWipeDevice command in PowerShell. This /seems/ to work, however it puts the device in a state of "Pending Wipe," and never resolves itself. Am I using this command incorrectly? Is there a way to force the phone into the wipe state after this Invoke command?

Thank you for any assistance you can provide on this!

-Joseph

Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,085 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,530 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Crystal-MSFT 48,766 Reputation points Microsoft Vendor
    2023-06-08T02:40:55.51+00:00

    @Joseph Dutton, Thanks for posting in Q&A. Based on my researching, I didn't find an updated script. For these devices, if we try the delete action in Intune portal, will the devices be removed? Or you can consider automatically delete devices with cleanup rule.

    https://learn.microsoft.com/en-us/mem/intune/remote-actions/devices-wipe#delete-devices-from-the-intune-admin-center

    Hope it can help.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Swahela Mulla 95 Reputation points
    2023-07-21T13:24:54.78+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.