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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Login is valid, but server access failed. Windows App can't login unless assigned SysAdmin.

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :Sql Server

I'm not sure if this belongs here or in a SQL Server forum.  It's an ADO.NET application though so I'm posting it here first.

Here is our environment.  XP workstations.  SQL Server 2005 Enterprise Edition, on Windows 2003 server.

We are putting together our first C# windows-based SQL application.  We want to install it on 50 to 100 workstations.  The first piece is very simple.  It starts by running a stored procedure which adds the user name and the current time to a table.   

If I put a test user into the SQL Server role [sysadmin] it works flawlessly.  If the user is not assigned that role I get the error "Login failed for Domain\User".  When I looked at the SQL Server logs, I see [Error :18456, Severity:14, State: 11.] which is telling me that the Login is valid, but server access failed.  Obviously, I don't want to give all our users sysadmin rights.


Essentially, we're trying to figure the minimum security settings that will allow our windows users to read, write, and delete from tables in a database, and execute stored procedures.  We thought we understood the security settings but we're missing something.  I don't know how to start with "sysadmin" and remove priveleges one at a time.

Here are a few things w

View Complete Post

More Related Resource Links

Login is valid, but server access failed. Windows App can't login unless assigned SysAdmin.


I put a similar plea for help in the ADO forum but haven't gotten responses. I have a feeling this is a better place to put this post. If someone thinks it should go elsewhere please let me know.

I've been stuck on this problem for a day and a half. I wrote a windows form application in C# that works flawlessley for myself and the other network admins. As soon as a normal user tries to use it it fails.

Our environment has XP workstations. SQL Server 2005 Enterprise Edition, on Windows 2003 server.

My application makes several connections but I wrote it so that it would test and give give meaningful error mesages every time it tried to connect to SQL server. The very first connection it tries to make fails, which thankfully forces the application to exit before ay other connections are made. This first piece is very simple. It runs a stored procedure that adds the user name and the current time to a table. For normal users, I instantly get the error "Login failed for Domain\User". When I looked at the SQL Server logs, I see [Error :18456, Severity:14, State: 11.] which is telling me that the Login is valid, but server access failed.

We suspected it was a domain rights issue since the network admins can run the aplication successfully, but as it turns out the network admins and developers all have the SQL role "sysadmin". If

Login to SQL, using Windows 7, SQL Server Error 18452, "Login failed. The login is from an untrusted

I have a File/Sharing Server which is Server 2008 SP2 and SQL Server 2008 is installed on it. My system which is on the same workgroup, was running Windows 2003 Server, which I have saved Server 2008 login credential on it and used that credential to login to SQL Server on Server 2008 system in Windows Authentication mode using SQL management studio. Recently I installed Windows 7 on that system, and I have also saved that Server 2008 credential in Windows 7 Credential Manager. The problem is here when I want to login in Windows Authentication mode using SQL management studio like past, and I will get below Error: Cannot connect to [SERVER] Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. (.Net SqlClient Data Provider) Error Number: 18452 Severity: 14 State: 1 Line Number: 65536 I tried that registry solution (DisableLoopbackCheck=0x01 this thread), but no luck with that. I have checked the outgoing packets when I click on connect, and I found out that SQL management studio tried to send my local windows credential instead of Server 2008 saved credential. I don't want to login in SQL Mode, and also I don't want to convert my server to Domain controller. Is there any other solution with this issue? Regards

Login failed for WINDOWS Administrator login. (Microsoft SQL Server, Error: 18456)

Hi All, I am using SQL server 2008. While adding SQL user i unknowingly deleted the SQL authentication user from SQL server. Now the problem is i can not login with Windows Authentication neither i can login as "sa" user as this user is disabled. Please suggest me how to get in to SQL server management studio. Database is up and running but i can not access the database any more after doing this blunder. Please suggest me how to recover SQL instance, Thank you.

Login failed for user: Reason:Token-based server access validation failed with an infrastructure err



I have installed a named instance of SQL Server 2008 R2 Enterprise 64 bit on Windows Server 2008 R2 Enterprise 64 bit. The os is running as a VM ware virtual machine.

I have created an AD security group for database engine sys admins on that machine. I added my user to that group.So for example;

domainname\machinename_SQL_DBE_SysADmins is a user with SysAdmin server role permissions. User domainname\MichaelEFF is a member of this group.

When I log onto the machine as this user and run the management studio with run as administrator I cannot log into the database engine. The log shows the error:

Login failed for user: Reason:Token-based server access validation failed with an infrastructure error

I've read many posts where the MVP says that the UAC is not passing the group membership. Is this the case? If so then how will role based access ever be possible with windows authentication? How can this be resolved?




Login failed for user:Token-based server access validation failed with an infrastructure error


I would appreciate help with the following issue:


I have created a local group in our SQL 2008 server and added two Windows user accounts "DOMAIN\UserName"  I  then added the local group to the database and granted read only access.


The users are trying to link tables using MS Access using and ODBC connection and getting the following error.

Users are not system administrators.


Date                      6/30/2010 1:01:54 PM

Log                         SQ

Login Failed for User "XXX" when login from a ETL machine for Sql Server 2005 SP2

Hi Guys, I have a straange issue with Login Failed errors coming intermittently probabaly twice in a week: I have a  production Database on Server A and we have Two ETL servers on Server B and Server C. Sometimes when the ETL's (SSIS) run from SERVER B I do get an error stating login failed for user "XXX" this user is a sql server user. And when I run the same package from Server C it does not give any error and runs smoothly. Both the packages uses the same configuration file to connect to the same database with the same user credentials. Also this error is not a frequent error but comes along once or twice in a weeK. Can anyone shed some light on this and let me know the root cause. Both servers have the same sql client version as well. All servers mentioned above are 64 bit windows 2003 servers. Raju

SQL Server 2005 "Login failed for user" sa

I have not been able to install SQL Express SP2 (standard or advanced) on Vista Ultimate (RTM). Every time I try to install, I get the following error message: SQL Server Setup could not connect to the database service for server configuration. The error was: [Microsoft][SQL Native Client][SQL Server]Login failed for user 'sa'. Refer to server error logs and setup logs for more information. When I check the logs, the only information I can find that is at all useful is: Doing Action: Do_sqlScriptPerfTime Start: Do_sqlScript : Thu Mar 01 21:35:42 2007Service MSSQL$SQLEXPRESS with parameters '-m SqlSetup -Q -qSQL_Latin1_General_CP1_CI_AS -T4022 -T3659 -T3610 -T4010' is being started at Thu Mar 01 21:35:42 2007SQL service MSSQL$SQLEXPRESS started successfully waiting for SQL service to accept client connectionsService MSSQL$SQLEXPRESS started at Thu Mar 01 21:35:48 2007SQL_ERROR (-1) in OdbcConnection::connectsqlstate=28000, level=-1, state=-1, native_error=18456, msg=[Microsoft][SQL Native Client][SQL Server]Login failed for user 'sa'.         Error Code: 0x80074818 (18456)Windows Error Text:   Source File Name: lib\odbc_connection.cppCompiler Timestamp: Wed Jun 14 16:28:15 2006     Function Name: OdbcConnection::connect@connectSource Line Number: 148 Has anyone else run into this issue and resolved it? I have seen posts for earlier versions of SQL Express that said to run

Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection

Hello All, Suddenly, the sql server is down, in the log file, C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG, I found the record as follows, 2007-03-05 15:40:31.59 Logon       Error: 17189, Severity: 16, State: 1.2007-03-05 15:40:31.59 Logon       SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection. Check the SQL Server error log and the Windows event logs for information about possible related problems. [CLIENT:] What else I can do to further investigate? Thanks Spencer

Installing SharePoint 2010 with SQL Server 2008 - SQL Exception - Login Failed

Hello I've been trying to install SharePoint 2010 with SQL Server 2008 in my Windows Server 2008 R2 box. I've got the same error all the times. System Specifications Windows Server 2008 R2 SQL Server 2008 with SP1 SharePoint 2010 Enterprise 6GB RAM, 320GB HDD Installation Steps I followed Installed Windows Server 2008 R2 and joined it to our domain Logged in as domain administrator Installed SQL Server 2008 Selected the Local Service account for all the SQL Server 2008 services during installation Selected Mixed mode authentication Selected 'Add Current User' in all the other installation screens Installed SQL Server 2008 SP1 Installed SharePoint 2010 Selected Farm option Selected Complete Installation Tried to run the configuration wizard and got sqlexception error - login failed But i checked that the current user (domain admin) is having all the permissions. Also added the domain admin as Security Admin and DB Creator in SQL Server instance. Any ideas?  Regards NLV Visit SharePoint User group - India

general error login failed for user '' on windows 2008 in application that runs correctly on windo



we have a web application that one company prepared for us. this application read connection string from registery key in hkey_local_machine and connect to sql server 2005 database.

It worked correctly in windows server 2003. we changed our Server'OS to windows server 2008. but we have a problem to login. after try to login we see this error :

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Server Error in '/dabir' Application.

Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user ''. The user is not associated with a trusted SQL Server connection.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be

Login failed for user 'XXX'. Reason: Attempting to use an NT account name with SQL Server Authenti


Under a network service account. I want to perform some operations on the SQL server DB.

I am passing the user id and password of the admin on that box. Still I am getting Login failed for user 'XXX'. Reason: Attempting to use an NT account name with SQL Server Authentication.

Is there any way i can connect to Sql server with user id and password?

Connection string i am using is Data Source=imdbstrs22;Initial Catalog=DataStore;Integrated Security=false;user Id=XXX;password =Imdbaug#10;





SQL Server Login - Windows Groups

We are trying to standardise access to SQL Server in our oraganisation.

We are installing SQL Server Management Studio locally for all our developers and DBA's.

The DBA login in sql server has been given the 'sysadmin' role. The DBA domain account has been made a member of the following Windows Groups,

- Remote Desktop Users
- Users

Our developers have been given the appropriate database role. Their domain admin account has been made a member of the following Windows Groups,

- Users

Can you advise whether this is a correct setup, if not can you suggest an alternative ?
Do we need to put Developers in the 'Users' group ?


Linked Server Mapping Error "Access to the remote server is denied because no login-mapping exists"


SQL Server 2005 SP3 32bit server
Connecting to an Oracle 10g server
Loaded OracleClient 10g

I'm able to ping the Oracle Server, and ODBC connect and able to run an open query with a single remote user id.

Issue: When I use the security context "Be made using this security context" it connects.
When I choose the "Not Be Made" WITH THE SAME USER ID & PASSWORD, I get the mapping error.

Error Installing SQL Server 2008 Express: '' is not a valid login or you do not have permission


I have tried installing SQL Server 2008 multiple times on my machine, and I always receive this error about 3/4 of the way through: '' is not a valid login or you do not have permission.

I have tried installing both SQL Server 2008 Express with Tools and SQL Server 2008 with Advanced Services, and they both fail the same way. I am trying to do a new stand-alone installation.

I'm running Windows XP Home Edition SP3.

Looking into the error, some forums say I have to install it from THE Administrator account, and not an account with administrator permissions; it also cannot be in Safe Mode, because then the Windows Installer won't work. Unfortunately, I haven't been able to login to the Administrator account. I can go to the home login screen, do ctrl+alt+del twice, and attempt to login to the Administrator account, but I receive this error: Unable to Log You on because of an Account Restriction.

Other forums say that in the Server Configuration section, all you have to do is provide the username and a strong password from an administrative account on the computer, and it doesn't have to be THE Administrator. Well, I did that, but for some reason it doesn't recognize my username and passw

SQL Server: Login failed for user: '\$'



I hate to be the 12345th person to request assistance on this topic, but despite looking at previous requests, I can't seem to find the solution. Any assistance you could offer would be much appreciated.


I have a new ASP.NET 2.0 web application which is hosted on (for argument's sake) WEBSERVER (using IIS 6.0), and which accesses data on SQLSERVER (using SQL Server 2000).

Because this is an intranet application, I want the application's authentication mode to be Windows, and the IIS authentication mode to be Integrated Windows (with Anonymous access disabled). ie: IIS should authenticate the user as smithjohn and SQLSERVER should also authenticate the user as smithjohn.

I don't know if this is relevant, but because of an existing nasty Windows application, all relevant domain users already have their own <DOMAIN>\<username> User account on SQLSERVER.


When I build and browse the pages in Visual Web Developer Express, I can retrieve information from SQLSERVER without any problems.

When I publish the site, and upload it to WEBSERVER, I get the following error upon attempting to retrieve data from a stored procedure on SQLSERVER:


SQL Server 2005 random login failures for windows forms application


One of our VS .NET 2008 windows forms applications runs from multiple client machines. The application randomly has login failures from random machines and from random places in the code. The login works almost every time but about once every fifteen minutes an error shows up in SQL Server error logs from a random user. We are running a clustered SQL Server 2005 system and the database is in 2005 (90) mode.

The following error appears in the SQL Server error logs:

Login failed for 'App_Login'. [CLIENT: XXX.XXX.X.XXX] Error: 18456, Severity: 14, State: 16.

The following error is what the client sees:

How to check (login Credentials) user name and password to access sharepoint server 2007 programmati

my issue is...

while user entered his/her Username:xyz
i need to check programmatically either username & password exists ot not in sharepoint server 2007 from windows form application.

and i know how to check username,but i don't know how to check password.

you can check username in below ways..

 SPSite SharepointSiteObj = new SPSite(SiteUrl);
 SPWeb SharepointWebObj = SharepointSiteObj.OpenWeb("/");

 SPUserToken token=SharepointWebObj.AllUsers[userName]

from this i can get user name..




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