Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I manually enter my credentials in SQL Server management Studio 2008 when using Windows Authentication?

Tags:

ssms

ntlm

Usually, when using Windows Authentication, the software (eg Internet Explorer) tries to use Windows Authentication, and if it doesn't succeed (because the domain is untrusted, or because the credentials are not ok for example), it just popups a login window so that you can input your domain, login and password.

With sql Server Management Studio 2008, if I select "Windows Authentication", the login/password boxes are autopopulated with my current credentials, and if I try to login, it says :


Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. (Microsoft SQL Server, Error: 18452)


I never get a chance to enter my credentials on the server domain...

I know I can fix this by either joining the domain on my computer, or enabling "sql server authentication", but that's not what I want :)

Any ideas on how to solve this?

like image 337
Brann Avatar asked Jan 24 '09 15:01

Brann


People also ask

How do I add credentials to SQL Server?

Right-click the Credentials folder and select New Credential.... In the New Credential dialog box, in the Credential Name box, type a name for the credential. In the Identity box, type the name of the account used for outgoing connections (when leaving the context of SQL Server).

How do I change the Windows Authentication user in SQL Server Management Studio?

Change authentication mode with SSMSIn SQL Server Management Studio Object Explorer, right-click the server, and then click Properties. On the Security page, under Server authentication, select the new server authentication mode, and then click OK.

Could not connect to SQL Server using Windows Authentication?

Resolution to SQL error code 18456Go to the Properties of the selected server (from the right-click menu). Now go to the Security page and under Server authentication choose the option SQL Server and Window Authentication mode. Now expand Security > Logins and right-click the server name, and select Properties.

How do I enable SQL Server and Windows Authentication mode?

2.3 Enabling SQL Authentication or Mixed AuthenticationRight-click the server you wish to modify and then click Properties. Select the Security Page. Under the Server authentication heading choose either the desired authentication: Windows Authentication or SQL Server and Windows Authentication mode. Click OK.


2 Answers

try this: Use RUNAS to set your Windows Auth domain for database connections

runas /user:domain\user “C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe” 

runas /user:domain\user “C:\WINDOWS\system32\mmc.exe /s \”C:\Program Files\Microsoft SQL Server\80\Tools\BINN\SQL Server Enterprise Manager.MSC\”" 

runas /user:domain\user isqlw 
like image 72
Gulzar Nazim Avatar answered Jan 01 '23 09:01

Gulzar Nazim


Trusted Authentication will use the credentials that you are logged into the machine with to try and connect, there’s not a way round this, if you want to use trusted authentication for management studio, you need to be logged on to your machine with an account that is allowed access to SQL, if not then you will have to use SQL authentication.

Edit: As posted by Gulzar, RunAs would be a definate solution to this.

like image 32
Sam Cogan Avatar answered Jan 01 '23 08:01

Sam Cogan