Daniel Palme

Daniel Palme

.NET consultant from Germany.

Blog > SQL Server 2012 - Access database with Windows authentication using IIS

SQL Server 2012 - Access database with Windows authentication using IIS

After setting up Windows 8 and SQL Server 2012 my ASP.NET applications were not able to access my SQL databases.
Whenever I have to setup a PC in the future, I don't want to waste my time (again) to figure out how I have to configure the users correctly. Here is what I did:

My SQL Server is configured to use Windows authentication. First I changed the user(s) of my AppPools in IIS Management to 'NetworkService'.

IIS - AppPool Identity

After that I opened SQL Management Studio and added a new login by selecting 'Security' -> 'Logins' -> 'New Login...':

SQL Server - Login

Now I was able to set the owner of the database to 'NT Authority\Network Service' (in German: 'NT-AUTORITÄT\NETZWERKDIENST'). IIS was now able to access my SQL Server.

SQL Server - Owner


Subscribe to RSS Feed

Tags: .NET, ASP, IIS
 

Related posts

 

New comment

:

:

:

:

 

Comments

#1
zgps

zgps

01/06/2013

You will have to go far from windows, if you don't want to waste time each time that they come up with a new business plan.