Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’

I was experiencing a similar error message that I noticed in the Windows Event Viewer that read:

Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’. Reason: Failed to open the explicitly specified database. [CLIENT: local machine]

The solution that resolved my problem was:

  1. Login to SqlExpress via SQL Server Management Studio
  2. Go to the “Security” directory of the database
  3. Right-click the Users directory
  4. Select “New User…”
  5. Add ‘NT AUTHORITY\NETWORK SERVICE’ as a new user
  6. In the Data Role Membership area, select db_owner
  7. Click OK

Here’s a screenshot of the above:
Screenshot of adding new user Network Service as db_owner to SqlExpress

Leave a Comment