How do I add NETWORK SERVICE login via SQL Authentication?

salvationishere picture salvationishere · Jun 21, 2010 · Viewed 16k times · Source

I am trying to add the NETWORK SERVICE login cause I still can’t connect to the AdventureWorks3 database. But I want to add this NETWORK SERVICE login via SQL Server Authentication and not Windows.

When I select Windows authentication, it lets me create this login. But when I select SQL Server Auth, it gives me the following error: Create failed for Login ‘NT AUTHORITY\NETWORK SERVICE’…’NT AUTHORITY\NETWORK SERVICE’ is not a valid name because it contains invalid characters. (MS SQL Server, Error: 15006)

Answer

gbn picture gbn · Jun 21, 2010

NT AUTHORITY\NETWORK SERVICE is the local server account name. When the server is part of a domain, "network service" becomes DOMAIN\ServerName$ and this can be used for a Trusted/integrated/Windows login

CREATE LOGIN [BigCompany\JustOneServer$] FROM WINDOWS

If it's not part of a domain, use a SQL Server login.