Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using SQL Servre 2008 R2. I recently changed my domain name and after that when I try to login to SSMS using Windows authentication, I get an error

Login Failed For User UserName
Microsoft Sql Server Error : 18456.

How to resolve it? Can somebody please help to get login in SSMS using Windows authentication mode again?

Thanks in advance

share|improve this question
What to do if SQL Mode is disable or don't know sa password – Ananta Sundar Shrestha Jul 18 '13 at 8:41
up vote 4 down vote accepted

You should login with sql authentucation (with your sa account) and run this query

DROP LOGIN [OldDomain\UserName]


ALTER SERVER ROLE [sysadmin] ADD MEMBER [NewDomain\UserName]

and then you will be able to login with your new domain name (be sure you change the domain name and username in the code) if you need to recover your sa password you can read this article

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.