Sql-server – Cannot add Network Service as User/Login

authenticationloginssql-server-2016windows-server

I want to setup ProGet on a 2016 server with SQL Express and IIS.

Both the service and IIS web runs under the Network Service user. None seem to be able to access the Database on a local SQL Express instance.

The IIS website tells me that the login WORKGROUP\PACKAGE$ (where PACKAGE is the servers name) cannot access the database:

Cannot open database "ProGet" requested by the login. The login failed. Login failed for user 'WORKGROUP\PACKAGE$'.

I understand that I need to add the Network Service (which IIS uses to actually authenticate with SQL Express) as a login/user to the database.

Existing Logins/Users

When I tried adding the NT-Authority\Network Service as a login/user to the database, I get an error that tells me that Windows cannot find any authentication for the Network Service.

Cannot find user or group PACKAGE\Netzwerkdienst

How can this be? Why can't SQL Express find the Network Service?

Best Answer

It can be a bit misleading, when working with the German version of SQL Server and/or a Windows Client/Server OS.

When you select the <HOSTNAME>\Network Service from the Active Directory pop-up in the SQL Server Login dialog, then SQL Server automatically displays the login (when closing all the dialogues with OK) as:

 <HOSTNAME>\Network Service

This is actually wrong.

German Solution

If you enter the following German string then it will resolve correctly:

NT-Autorität\Netzwerkdienst

English Solution

If you were to use an English Windows / SQL Serer installation then you would have to enter:

NT-Authority\NetworkService

If you click on OK, then the SQL Server Login will be created.

SQL Server Logins displaying NT-Autorität\Netzwerkdienst Account