Where does SQL server store AD user credential

zhiqing zhou 76 Reputation points
2021-06-10T21:37:41.503+00:00

I have an user account ESCxxx\xxxport (AD account), created as sql login in two sql servers. One is showing ESCxxx\xxxportnew, another shows normally as ESCxxx\xxxport.
when I login on a PC and open SSMS with that AD user, the two sql server instances showing different name (see screenshot 1)
Screenshot2 shows this user's actual name is ESCxxx\xxxport in AD
screenshot3 shows when I open a sql agent job in the weird instance , it attempted to authenticate with the user in another domain (decommissioned domain) , not sure how it works and where it stored the old domain user info,
contacted MS support, but they need more time to do research. Just wondering if anyone has some answers.
104424-s1.png104405-s2.png104406-s3.png

SQL Server Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2021-06-11T06:37:00.51+00:00

    Hello,

    SQL Server stores the Windows login SID and name on creation of the SQL Server login and newer update it.
    If you rename the Windows login name in AD, the name stored in SQL Server remain, until you manually update it.
    The login will still work, because for auth SQL Server always uses the SID only and not the name.

    You can update the name with ALTER LOGIN, like

    ALTER LOGIN [Domain\OldName] WITH NAME = [Domain\NewName];  
    

  2. AmeliaGu-MSFT 14,006 Reputation points Microsoft External Staff
    2021-06-11T07:44:02.767+00:00

    Hi zhiqingzhou-0982,

    Welcome to Microsoft Q&A.
    We can use master.sys.syslogins and master.sys.server_principals to view user information.
    Could you please check if wrh\xxxport is existing in the master.sys.syslogins?
    Have you tried to recreate a new job?

    Best Regards,
    Amelia


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.