locked
How to change windows authentication account when connecting in object explorer. RRS feed

  • Question

  • I recently had my computer domain switched. When I set up my sql server instances they were set to the other domain account on my machine. Is there anyway I can change to the old domain account. The old domain account still exists and I'm running sql managment studio under that domain account, but when I go to connect to a server using the object explorer it try to use my new domain account. Can I switch it or is there a script to connect to a datbase in sql managment studio I can run instead?

    Just PerdueIT


    Thursday, September 27, 2012 9:27 PM

Answers

  • Not sure I understand this. If you are logged into Windows as DOMAIN\USER2, you can only connect to SQL Server as DOMAIN\USER2. The only way you could connect as DOMAIN\USER1 from SSMS would be if you started SSMS through runas, providing the password for USER1. But this case case, SSMS would not suddently try to connect you as USER2 since the SSMS process is logged in as USER1.

    Are you using runas at all?


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Marked as answer by Just Perdueit Thursday, September 27, 2012 10:03 PM
    Thursday, September 27, 2012 9:39 PM
  • Something like that I was using the runas command when I posted but I didn't put the correct creds in for it to work correctly. This is the command im using "runas /netonly /user:<domain>\<username> ssms.exe" no qoutes and it works like z charm. Thanks for the help though runas is z solution.


    Just PerdueIT

    • Marked as answer by Just Perdueit Thursday, September 27, 2012 10:04 PM
    Thursday, September 27, 2012 10:03 PM

All replies

  • Not sure I understand this. If you are logged into Windows as DOMAIN\USER2, you can only connect to SQL Server as DOMAIN\USER2. The only way you could connect as DOMAIN\USER1 from SSMS would be if you started SSMS through runas, providing the password for USER1. But this case case, SSMS would not suddently try to connect you as USER2 since the SSMS process is logged in as USER1.

    Are you using runas at all?


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Marked as answer by Just Perdueit Thursday, September 27, 2012 10:03 PM
    Thursday, September 27, 2012 9:39 PM
  • Something like that I was using the runas command when I posted but I didn't put the correct creds in for it to work correctly. This is the command im using "runas /netonly /user:<domain>\<username> ssms.exe" no qoutes and it works like z charm. Thanks for the help though runas is z solution.


    Just PerdueIT

    • Marked as answer by Just Perdueit Thursday, September 27, 2012 10:04 PM
    Thursday, September 27, 2012 10:03 PM