0

Have my service set to login using 'Local System Account' with 'Allow service to interact with desktop' ticked.

Here's my C# connection string which works allowing interaction with DB when I execute the application outside of the Quartz/Windows Service:

  <connectionStrings>
  <add name="ArbDBConnStr"
      connectionString="Data Source=(LocalDB)\MSSQLLocalDB;Initial Catalog=aspnet-Arb-20160906102730;Integrated Security=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>

What do I have to do to enable the the windows service to be able to access the db?


UPDATES - STILL NO JOY enter image description here

enter image description here

Also no info in SQL Server logs that I can see that would shed any light - what should I be seeing?

enter image description here

walen
  • 7,103
  • 2
  • 37
  • 58
user6063812
  • 191
  • 2
  • 15
  • 1
    Take a look at this: [SQL Server Login error: Login failed for user 'NT AUTHORITY\SYSTEM'](http://stackoverflow.com/questions/24822076/sql-server-login-error-login-failed-for-user-nt-authority-system). Try some of the suggested answers. – Keyur PATEL Sep 20 '16 at 04:22
  • thanks tried the suggestion adding sys admin but still no joy. However, saw this error in event viewer - not sure if this could have anything to do with it and not sure how - if necessary - to fix it either:----------- The service is marked as an interactive service. However, the system is configured to not allow interactive services. This service may not function properly. – user6063812 Sep 20 '16 at 04:47
  • Looks like that is nothing to worry about but also noticed this:------------------------- The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {8D8F4F83-3594-4F07-8369-FC3C3CAE4919} and APPID {F72671A9-012C-4725-9D2F-2A4D32D65169} to the user NT AUTHORITY\SYSTEM SID (S-1-5-18) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool. – user6063812 Sep 20 '16 at 04:51
  • For the interactive service error, try the 'Resolve' solution from [Event ID 7030 — Basic Service Operations](https://technet.microsoft.com/en-us/library/cc756339(v=ws.10).aspx) while your service is running. – Keyur PATEL Sep 20 '16 at 04:57
  • For the second one, follow the steps here: [error: “The application-specific permission settings do not grant Local Activation “](https://blogs.msdn.microsoft.com/mutaz/2009/02/11/error-the-application-specific-permission-settings-do-not-grant-local-activation/). – Keyur PATEL Sep 20 '16 at 05:03
  • It seems very unlikely that you need to set the "allow service to interact with desktop" option. That's long-deprecated functionality. – Harry Johnston Sep 20 '16 at 05:12
  • yes ignoring that - just going through everything. No joy yet. Will keep digging. thank you all. For the second error above I dont have the IIS WAMREG admin service referred to in the link. – user6063812 Sep 20 '16 at 05:14
  • 1
    Have you looked in the SQL logs to determine the cause of the logon failure? – Harry Johnston Sep 20 '16 at 05:53
  • Please see updates: - Have set User 'NT AUTHORITY\SYSTEM' Server Roles to sysadmin as well as public and have mapped 'NT AUTHORITY\SYSTEM' to the DB with db_owner and public role membership all displayed in images above. Also included SQL Server Logs which seem to be unhelpful - what should I be expecting to see that could help pinpoint the problem? – user6063812 Sep 20 '16 at 15:38
  • @user6063812 I have the same problem an i am going crazy. None of the recommended fixes help. Did you manage to resolve this? – T M Apr 20 '21 at 10:25

1 Answers1

0

For anyone still struggling with this issue what i did was simply :

  1. Open SSMS --> Security --> Logins --> 'NT AUTHORITY\SYSTEM'
  2. Right-click --> Properties
  3. Give 'NT AUTHORITY\SYSTEM' sysadmin and public Server Roles (by the way public is there by default)

4.Under User Mapping ensure your database is ticked i.e also mapped to NT AUTHORITY\SYSTEM

Golide
  • 835
  • 3
  • 13
  • 36