Good morning. I ran into an interesting issue a couple of weeks ago. I had a customer that was not able to join any of their client systems to a newly created Windows Essentials domain. When running the domain join wizard they were receiving a generic error. When digging into the event log we were able to find an error code in the following event.
Event ID: 4097
The machine <server name> attempted to join the domain <domain name> but failed. The error code was 2700.
So what does error code 2700 mean anyway. I did some checking and could not find a good answer. I dug into the clientsetup.log and found the following line that gave me the answer I was looking for.
 170119.143840.1334: ClientSetup: nativeNetJoinDomain returned ErrCode=2700
 170119.143840.1334: ClientSetup: Join domain fails on the first time, exception: System.ComponentModel.Win32Exception (0x80004005): This 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
This makes sense as a client cannot be connected to two domains at the same time.
Now that we know what the issue, here is the fix.
- Open the settings menu in Windows. This can be done by clicking start icon and choosing Settings. Choose the Accounts option.
- Pick the Access work or school option.
- Click on the Azure connection to bring up the option to disconnect.
- When you click on Disconnect, you will get a prompt. Click Yes.
- You will get another prompt. Choose Disconnect again.
- Enter alternate account information and click OK.
- Finally choose the option to Restart now.
After restarting you should now not have any issues joining the Windows domain.
I hope you found this article informative. If you have anything to add or want to comment, please do so below.