Processes in Microsoft 365 for setting up Office apps, redeeming product keys, and activating licenses.
Dear @Emma
I understand how frustrating it is to get locked out with the error "This device was deleted by your organization" after clearing out previous device registrations.
This error happens because Windows and OneDrive are still holding onto stale Azure AD (Entra ID) authentication tokens and device identity records locally, even though the device object was removed from Microsoft 365.
Here is the direct solution to clear those cached identities and successfully re-enroll each PC under its intended user account:
Step 1: Disconnect the Stale Work or School Account
- On the affected PC, open Settings > Accounts > Access work or school.
- Select the existing user account/organization connection and click Disconnect.
- Restart the computer.
Step 2: Clear Cached Credentials and Microsoft Account Identities
- Open the Start Menu, search for Credential Manager, and select it.
- Select Windows Credentials.
- Under Generic Credentials, look for any entries starting with OneDrive Cached Credential, MicrosoftOffice16, or SSO_Identity and click Remove.
- Press Windows Key + R, type regedit, and press Enter.
- Navigate to: HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity
- Locate the Identities folder, right-click it, and select Delete. (This forces Microsoft 365 to start a completely fresh authentication prompt).
Step 3: Clear Stale Azure AD/Entra ID Registration Tokens
If the machine was Workplace Joined or Hybrid Entra Joined, you need to unregister the old device token via Command Prompt:
- Open Command Prompt as an Administrator.
- Run the following command to check current join status:
dsregcmd /status - Run this command to force unregister the deleted device identity from the local machine:
dsregcmd /leave - Restart the PC.
Step 4: Re-enroll the PC and Sign In
- After restarting, go to Settings > Accounts > Access work or school.
- Click Connect and sign in using the new, unique Microsoft 365 user credentials designated for that specific PC.
- Open the OneDrive app and sign in with the corresponding user account.
For further technical background on device cleanup and re-enrollment behaviors, you can review Microsoft's official guidance: Troubleshooting devices using the dsregcmd command
Please let me know if you encounter any specific error codes during re-enrollment.
If the answer is helpful, please click "Yes" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in the forum document to enable e-mail notifications if you want to receive the related email notification for this thread.