I have created a Service in C# in which I am performing two tasks.
Task-1: Extracting Windows Event Logs.
Task-2: Sending the desired log (if present) to a Database that reside on another system.
If I run this Service under LocalSystem Account, it successfully performs Task-1 because its System related, but not Task-2 because LocalSystem Account does not have access to Network.
If I run this Service under NetworkService Account to access the Database on other Machine, it does not perform Task-1 because NetworkService Account has Limited access over System resources. Due to this, it is unable to extract Windows Event Logs.
I know that my code is correct because I have tested the whole code in Console Application and it performs both Tasks correctly.
I need the solution through which I can perform both Tasks through a Service.