.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

How to connect to a different SQL server by using Windows Authentication?

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :
 

Hi all

Version: SQL Server 2008 R2

When I use my SQL Server Mgt Studio -> Connect... Database Engine... then click on Authentication: Windows Authentication, my username is gray out and it grabs my current domain\username. I need to type a different Domain\Username.

How do I do that if the field is grayed out?

Thank  you


JCD


View Complete Post


More Related Resource Links

SOS: Cannot connect to SQL Server 2005 locally by Windows Authentication DOMAIN \ myname. But networ

  
Cannot connect to SQL Server 2005 locally by Windows Authentication DOMAIN \ myname. But network connection is successful.   But SQL Server Logins contain   BUILTIN \ Administrators, and                                                    BUILTIN \  Administrators contain DOMAIN \ Domain Admins, and                                                    DOMAIN \ Domain Admins contain DOMAIN \ myname.   Creating SQL Server Login with DOMAIN \ myname entail successful local connection.   Removing SQL Server Login with DOMAIN \ myname and creating SQL Server Login with DOMAIN \ Domain Admins do NOT entail successful connection. Cannot connect! System:   Windows Server 2008. Error 18456

Cannot connect to SQL Server 2005 locally by Windows Authentication, but network connection is succe

  
Cannot connect to SQL Server 2005 locally by Windows Authentication DOMAIN \ myname. But network connection is successful.   But SQL Server Logins contain   BUILTIN \ Administrators, and                                                    BUILTIN \  Administrators contain DOMAIN \ Domain Admins, and                                                    DOMAIN \ Domain Admins contain DOMAIN \ myname.   Creating SQL Server Login with DOMAIN \ myname entail successful local connection.   Removing SQL Server Login with DOMAIN \ myname and creating SQL Server Login with DOMAIN \ Domain Admins do NOT entail successful connection. Cannot connect!                                     &

Cannot connect to local server with windows authentication

  

When I try to connect to my local server using windows authentication I get the following error:

Login failed for user 'Will-PC\Will'. (Microsoft SQL Server, Error: 18456)

 

It happens if I try to give the server name as WILL-PC, (local), localhost, or "."

I am on Windows 7, and I am using SQL Server 2005 Standard edition, the and SQL Server service is running.  I can't get into the server in any way to see what users are available.  Please help!


Net.TCP Endpoint; Windows Authentication security; client can connect to a server at localhost but n

  

Hey all, so here's what going on:

Situation
I have a WCF Service that I have setup as a Windows Service.  Everything works perfectly when I attempt to use the system with all of the components (i.e. server and clients) on the same machine.  However, when I try to connect my client from a different system, I get an error that is trying to tell me that the server rejected the client's credentials.

Objective
I need the client to the able to connect from a different machine.  I want to implement a SQL Role Provider kind of credentialing in the future, but for now, I just need it to work.

What I have tried
I have looked around online and read a few other posts as well some things in the MSDN KB and I have either not found the answer, or not understood it.

  • I have tried setting the <security mode="Transport"> to "None" with the hope that that would disable the accreditation entirely.  All it did was result in a different error saying that there was an error that might have been caused by an invalid message.  I have also tried a few other configurations with this element in the app.config file; to no success.
  • I have read some things about Impersonation, but I am not quite sure I understand how to implement it

How to impersonate a connection to SQL server under IIS app pool account if Windows Authentication i

  
I have a requirement I should connect to MS SQL server under IIS Application pool account from ASP.NET application where Windows Authentication is enabled. I cannot use user name and password in connection string. ASP.NET application should use Entity Framework 4.0 to work with data. Any ideas how to do it?    

ODBC connection to SQL Server 2005 Standard (on windows xp) with Windows authentication does NOT wor

  
I reviewed lots of postings, still could not find an answer. If I choose Windows authentication: - with TCP/IP and "Dynamically determine port" checked, I get the following error "The user is not associated with a trusted SQL Server connection; - with Named Pipes, Server Name & Pipe Name as "VSAXAONG", I get two errors, one after the other on the same pop-up:       Connection failed  SQL State 01000  SQL Server Error 1385 [Microsoft] [ODBC SQL Server Driver] [Named Pipes] ConnectionOpen (Connect()).       Connection failed  SQL State 08001 SQL Server Error 17 [Microsoft] [ODBC SQL Server Driver] [Named Pipes] SQL Server does not exist or access denied. If I choose SQL Server authentication and fill in the password - the ODBC connection works fine. I have to say that I created two different logins on the server, one for Windows authentication, and one for SQL Server authentication - both for the same Windows user name. I would appreciate any help I can get on this.  Thank you all in advance.

Using Windows Authentication for connecting sql server from web application using froms authenticati

  
Hi Experts, I have one web application which is configured to be use froms authentication. But, I don't want to use SQL Authentication to connect to SQL server, I want to use windows authentication. Can somebody plase give me detailed setps for how to implement this? Thanks for your help in advance. -Chintak. 

ASP.NET Forms Authentication connecting to SQL Server with Windows Authentication

  
Hi everyone, I am not sure if this is the correct forum - apologies in advance - I could not identify where it should go! I have an ASP.NET Web Application that uses Forms Authentication using System.Web.Security.ActiveDirectoryMembershipProvider for signing on using Windows credentials.  This works nicely and is solid. The problem I have is connecting to SQL Server.  I need to be able to connect to SQL Server using Windows Authentication (trusted_connection=yes or Integrated Security=SSPI).  This is critical so I can record the user that created/last modified specific records and also to collect "Task-based" records that are relevant to the currently authenticated user. I have tried Google and a tonne of variations of web.config entries, using Win API to impersonate etc...  The only way that I could make it happen was to:- 1. Use the web.config entry:   (please entry at the bottom of the post.  For some reason it won't go into the right spot in this post!) 2. Log on specifically as the user specified in the above web.config entry.  If I log on as anyone else (ie Authenticate as anyone else), then SQL server simply gets the ASPNET service account as the Windows user. I have laboured over this for hours upon hours.  I really would appreciate some assistance. Thanks in Advance, Joe     "<identity

how to change the web application Database connection form Windows authentication to SQL Server acco

  
Hi, I have a web application created and Database connection authentication was given as Windows authentication. how can i change it to a SQL server account in MOSS 2007. Thanks in advance.

Enabling Windows Authentication to SQL Server using Application Pool Credentials

  
I have created a WCF Service (VS2008), an application pool account which has the access to the SQL Server(in remote machine). Configured the App Pool account to the Virtual Directory in IIS (Version 6.0). Once I browse through the SVC file, I can see the WSDL file. I have the "Windows Authentication" and the 'Anonymous authentication" Checked in the Properties for the Virtual Directory. But when I access service through Client, I get "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.". Binding that is being used is HTTPBinding. I have set the Identity Impersonate to True as well. Bottom line is - I need to use the App Pool account to connect to the SQL Server. Could some one please help me in this?  

SQL Server 2008 Windows Authentication Mode fails for Database Engine, error 18456

  
I installed SQL Server 2008 Developer Edition (10.0.1600.22.080709-1414) on a Windows Vista 32-bit development machine with Windows Authentication Mode only (no SQL Server Authentication).   Since this is a development machine, I saw no need for Mixed Mode when I did the install.  The SQL Server Management Studio allows me to login to Analysis Services, Integration Services, Reporting Services, BUT NOT the Database Engine!Windows Authentication for the Database Engine gives the following error: EventID: 18456Login failed for user MYDOMAIN\MYLOGIN'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: <local machine>]The 'fix' I have found online is to login as SA in SQL Server Authentication mode & add MYDOMAIN\MYLOGIN as a administrator for the Database Engine.  Unfortunately, I can't since I didn't install SQL Server Authentication mode (only Windows Authentication Mode).  It appears my only recourse is to uninstall, then reinstall in Mixed mode, then to login as SA in SQL Server Authentication mode & add MYDOMAIN\MYLOGIN as a administrator for the Database Engine. Before I do so, does anyone know of a better approach?Scott D Duncan

Cannot Connect to SQL server with SQL 2008R2 enterprise On windows server 2008R2

  
I have 2 identical brand new servers Running Windows Server 2008 R2 not on a domain but simple LAN. I Installed a default instance of SQL server 2008 R2 enterprise on each one with all the default settings. No Problems during the Installaion. I Added the Windows Administrators Group and Users group to the SQL admins role during the SQL Server Installation. Remote connections are enabled on each server. I restored the same database from a copy on each Installation. Configured the user accounts on each maching and made them sysadmins and granted permissions where they were needed. Now from server A when i try to establish a connection to Server B from SQl server Management Studio I get An error stating that the server was not found or accesible. keep in mind i can \\server B\c$ and vice versa, named pipes are enabled. I have never had this problem before in my life. And it's happening on both servers. I really need each installation of SQL to be able to see the other remote installation as i have to create a mirror. -Chris

C# connect SQL server 2008 window authentication on workgroup

  

We have an application winform C# that connects to sql server 2008 with window authentication impersonation.
We need window authentication because of filestream requirement (we did not find other solution).

The application works fine in domain environnement. Our msi create same user on each computer and we use it to access to remote database.

But a lot of our customer are littre company (1 to 10 employees), they are in workgroup configuration, it is impossible to migrate them on domain environment.

We tried to impersonate but it doesn't works in workgroups :

public void Impersonate(string userName, string domainName, string password, LogonType logonType, LogonProvider logonProvider)
  {
   UndoImpersonation();
 
   IntPtr logonToken = IntPtr.Zero;
   IntPtr logonTokenDuplicate = IntPtr.Zero;
   try
   {
	// revert to the application pool identity, saving the identity of the current requestor
	_wic = WindowsIdentity.Impersonate(IntPtr.Zero);
 
	// do logon & impersonate
	if (Win32NativeMethods.LogonUser(userName,
		domainName,
		password,
		(int)logonType,
		(int)logonProvider,
		ref logonToken) != 0)
	{
	 if (Win32NativeMethods.DuplicateToken(logonToken, (int)ImpersonationLevel.SecurityImpersonation, ref logonTokenDuplicate) != 0)
	 {
	  var wi = new WindowsIdentity(logonTokenDuplicate);
	  wi.

problem with connecting to local SQL Server 2008 default instance using windows authentication

  

Hello, 

 

I have a user getting some problem with connecting to local SQL Server 2008 default instance using windows authentication with a user which has sysadmin role and is owner of each existing database:

2010-09-28 15:40:35.04 Logon       Error: 18456, Severity: 14, State: 11.

 

2010-09-28 15:40:35.04 Logon       Login failed for user 'IIS APPPOOL\RoomViewSEWebClient'. Reason: Token-based server access validation failed with an infrastructure error. Check for previous errors. [CLIENT: 127.0.0.1]

 

 

This us

cannot connect to sharepoint server intranet site through VPN with windows vista home premium 64bit

  
Hi, a company i work for has an intranet site using sharepoint 2008. i can connect to the intranet remotely through their vpn however i am not able to view the instranet site or ping the server it is on...

does anyone have any ideas on whether this might be a vista issue or ????

thanks,
jonathan

Mixed Authentication Using IIS 7 On Windows Server 2008

  

Hi Mike,
I have read your workaround for mixed authentication mode, and it works fine here on my own solution when i tried it, but my scenario for mixed authentication mode is a little bit different, it was working fine on IIS 6.0 ,but when i tried it on IIS 7 it didn't work.
My Secuirty settings for the app as follows:
- am using forms authentication and my login page called "Login.aspx".
- am using your custom module called "Mvolo.FormsAuthenticati

Windows 7/Server 2008 R2 + Office 2010 cannot connect to SharePoint 2010

  

I have a Windows 7 x64 machine, with Office 2010 x86 installed.  I also have (2) Server 2008 and (2) 2008 R2 machines with Office 2010 x86 installed on them. On all of these machines I can not connect to SharePoint 2010 using Office.  The following occurs:

  • From the browser, browse to a doc lib. 
  • Click on an Office document, select "Edit in Microsoft ..."
  • An "Open Document" dialogue box appears, indicating that "Some files can harm your computer. If the file information below looks suspicious, or you do not fully trust the source, do not open the file.  File Name: Whatever.docx  From: SPServer2010.  (This is the first clue that something is not working properly.  I don't think this would appear otherwise)
  • Click OK.
  • The document opens, but with a [Read-Only] in the title bar. 
  • If I click save, it tries to save to a default location on my desktop computer.

Another example of the problem:

  • Open an Office 2010 application. 
  • Click File>Open
  • In the Open dialogue box, type in the URL of a document lib on the server. 
  • The error message: You can't open this location using this program. Please try a different location.

Final example of the problem:

  • Click Upload Multiple
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend