Tuesday, July 25, 2017

Logon Failure: The target account name is incorrect after migration

This is article is about the steps that I had to follow to keep a host named and sharename active after websites on an old server in a different domain have been migrated to a new server and the old server was shut down.

ServerA.domain1.lcl -- Old Server
ServerB.domain2.lcl -- New Server

So After the directories were copied and IIS was configured on the new server, there were a few steps to follow in order to keep the share intact so that nothing had to be changed through program development.

1.  A CNAME had to be added in DNS so any queries against DNS will resolve the ServerA to the ip address of ServerB.  That is pretty simple.

2.  Create the share for the files moved using the same share name as on SeverA and give appropriate permissions.

 So the new Share name is :  \\ServerB\web  where as on the old server it was:  \\ServerA\web

3.  SeverA's NetBios name had to be added to the ServerB's server name list.  There are many ways to do this discussed in this article by Jose Berreto .
What I ended up doing was using the NetDom command:

NETDOM COMPUTERNAME ServerB /ADD ServerA
NETDOM COMPUTERNAME ServerB /ADD ServerA.domain1.lcl

 4. Clean up the old Server name.  At this point when I would try to connect to the share I got "The target account name is incorrect"  So what I had to do to correct this was:

add domain1.lcl to the "append these DNS suffixes"  list in the advance TCP/IP settings
Ipconifg /flushdns
Ipconfig /registerdns
on ServerB

Disable the ServerA Account
in Active Directory

Then I was able to access the Share using \\ServerA\Web