I am seeing this error when trying to change the workgroup of a local machine and have it join newly setup domain. I see this message: "The device is joined to Azure AD. To join an active directory domain you must first go to settings and choose to disconnect your device from your work or school"
In windows server 2019, I am unable to find any option that shows this machine connected to any Azure AD domain. Any suggestions?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@2adnan Thank you for the query. We will check and update on the same.
@2adnan
Suggest you to check if the VM is connected to any domain.
Go to the Settings-> Select Accounts
Then on the left side, select Access Work or School.
Then you should be able to see if the system is connected to any domain.
Now, if that is not the correct domain you want the system connected to, you can click on the same and then Disconnect from the joined domain. Then Click on Connect and follow the instructions to connect to the Domain of you choosing with the Admin Credentials of that domain.
Unfortunately in Azure provisioned Windows Server 2019 I dont see this option.
I only see these three i.e., Your Info, Sign in options, Other Users
@2adnan We would need further information on this for the issue. We would request you to open a thread in the MSDN Azure Forums or in the Microsoft Q&A Forum You can also raise a Technical Support Ticket so that our engineers can work with you on this.
We will be closing this thread here now. And we would work with you on either of the options you choose.
Was this issue ever resolved and if so, what was the resolution? I am experiencing the exact symptoms.
Had a similar incident and I opened a support ticket for this.
Eventually narrowed it down to a "preview" feature I selected while creating the VM (should not have enabled)

Had to recreate the Vm, but then it worked.
Thanks for the feedback. This was not my case. I have a 2016 Server that has been running in AD for 2 years. It was removed from AD and I am now trying to add it back into the same domain. For some reason, it suddenly thinks it is Azure AD joined, even though it is not. If I run dsregcmd /status, it shows as neither Azure AD nor Domain Joined.
Ran into same situation on 2019 DC and the Preview Feature TCBTech highlights. To avoid having to recreate VM I was able to use "dsregcmd /leave" after checking status. After that can join domain normally.