Can not Disconnect from Azure AD on Windows 10

Dan Bell 10 Reputation points
2023-05-05T05:16:39.77+00:00

If you join a Windows 10 machine to Azure AD and change the computer name before disconnecting from Azure AD then you will not be able to disconnect from Azure AD (e.g. your want to join a local domain). The reason is there is something hardcoded about the machine name that must be used. Change the machine name back to the original name, reboot and then disconnect from Azure AD. Then you can join the domain normally. One other caveat, the newer versions of Windows have the administrator account disabled by default. You will need to enable it and set a password or create another local admin user.

If you can't find the original machine name then you can use regedit and search for Data with "Desktop-" in Computer\HKEY__LOCAL__MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\DataStore

In your SID it will show szName with the data being DESKTOP-XXXXXX\defaultuser0. Grab just the DESKTOP-XXXXXX name and change your machine name to this.

I saw this posted before, but I was not able to add to the post so here is the answer and the previous tips did not help to find this. Rather than reinstall, I wanted to get to the bottom of it and save others from an hour or more of wasted effort. Enjoy!

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,195 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,630 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Dan Bell 10 Reputation points
    2023-05-05T05:17:14.2966667+00:00

    The reason is there is something hardcoded about the machine name that must be used. Change the machine name back to the original name, reboot and then disconnect from Azure AD. Then you can join the domain normally. One other caveat, the newer versions of Windows have the administrator account disabled by default. You will need to enable it and set a password or create another local admin user.

    If you can't find the original machine name then you can use regedit and search for Data with "Desktop-" in Computer\HKEY__LOCAL__MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\DataStore

    In your SID it will show szName with the data being DESKTOP-XXXXXX\defaultuser0. Grab just the DESKTOP-XXXXXX name and change your machine name to this.

    0 comments No comments

  2. Marilee Turscak-MSFT 36,411 Reputation points Microsoft Employee
    2023-05-09T20:37:11.9+00:00

    Hi @Dan Bell ,

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution in case you'd like to "Accept" the answer.

    Issue:

    When you joined a Windows 10 machine to Azure AD and changed the computer name before disconnecting from Azure AD, you (and other users) were not be able to disconnect from Azure AD.

    Solution:

    You needed to change the machine name back to the original name, reboot, and then disconnect from Azure AD. Then you were able to join the domain normally.

    One additional note is that newer versions of Windows have the administrator account disabled by default, so you need to enable it and set a password or create another local admin user.

    If you cannot find the original machine name you can use regedit and search for it with "Desktop-" in Computer\HKEY__LOCAL__MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\DataStore

    Thank you again for your time and diligence in reporting and sharing the solution on the Q&A platform.

    If you have any other questions or are running into more Azure AD or domain join issues, please let me know. If you would also like to share details about the issue you faced when trying to add an answer to the other post, feel free to tell me so that I can pass the information along to the platform team.

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments