How to disconnect a device from Azure Active Directory

When setting up a new PC, if you had to use a Microsoft account for the initial setup but want to set it up for local administration and you have exhausted other options for removing the Microsoft account from your PC, you can try the following method: 

1. Download PsExec from Microsoft (https://learn.microsoft.com/en-us/sysinternals/downloads/psexec) and extract files from the zipped file. 

2. Start the command prompt as an administrator. Go to the folder that contains the extracted Sysinternal Tools, and use PsExec to start a command prompt window under the System account privileges by typing “psexec—sid cmd.exe.” The System account provides higher privileges than an Administrator account. 

3. In the command prompt window, type “dsregcmd /leave” to unregister the device from Azure Active Directory. 

4. Restart the PC. 

5. Check the machine’s status by using the “dsregcmd /status” command, and it should show AzureAdJoined status as NO under Device Status. 

Leave a comment