Windows Server 2016

Windows Server 2016 Server Core the machine is already joined to the domain

With a Hyper-V lab, I ran into the error Windows Server 2016 Server Core the machine is already joined to the domain after rolling back a snapshot

In working a lot recently with Windows Server 2016 Core in a lab environment, I ran into an issue after rolling back a snapshot on a Hyper-V Server Core install. ย The snapshot rollback of course broke the computer account/domain relationship with the Windows Server 2016 Server Core install. ย However, I thought I would simply be able to disjoin the domain and rejoin to reset the computer account. ย When attempting to do that, I received the error with Windows Server 2016 Server Core the machine is already joined to the domain.

Windows Server 2016 Server Core the machine is already joined to the domain

The problem as well as that I couldn’t even back the Server Core install off to a Workgroup either. ย It still tries to hit the domain when joining a workgroup. ย Any domain join/disjoin action leads to theย the machine is already joined to the domain error. ย Part of my issue was the snapshot of the Hyper-V Server Core host was of a different computer name – the default, automatically generated computer name.

w16scdisjoin01

As you can see below, the orphaned computer account,ย H2, is there, however, communication with the domain is broken AND the rolled back snapshot is of a different name.

w16scdisjoin02

Let’s see if with some Posh Kung Fu, we can force the removal of the computer from the domain. ย Using the script below, still ran into the issue of it knowing the current computer name was different than the domain account.

remove-computer -computername "H2","localhost" -unjoindomaincredential TESTLABadministrator -Workgroup "WORKGROUP" -Restart -Force

w16scdisjoin03

Ok, so let’s try to use the current autogenerated name and see what happens. ย This time we receive a different error because the current computer name cannot be mapped to a computer account in the domain. ย So are we stuck?

w16scdisjoin04

Let’s see what happens when I simply create a shell computer account of the same name –ย WIN-NOSNEUISPF1 in the domain and then try the disjoin.

w16scdisjoin06

So, now we have the account created.

w16scdisjoin07

Now, I am going to use the sameย remove-computer commandlet and also specifying the autogenerated computer name now that we have a dummy computer account in AD.

w16scdisjoin08

Success!

w16scdisjoin09

Amazingly, just simply creating a computer account that it could see with the same name allowed us to disjoin the domain.

Thoughts

If you run into the error withย Windows Server 2016 Server Core the machine is already joined to the domain, then most likely you can simply stage a computer account in the domain to reflect what the Windows Server 2016 Server Core thinks the name should be, and then you can disjoin the computer from the domain and then rejoin. ย This was quite a lot of grief just to resync with the domain but this simple computer account trick seems to work like a charm.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.