We have a .net web application. The web application is configured in IIS and runs under AppPool, which runs under the domain \ User1
This web application has C # .NET code that provides access to the file on the server. The problem is that only for the domain \ User2 has the rights to this file for reading / editing.
We know that .NET code will run under the credentials of the AppPool account (i.e.: Domain \ User1). Therefore, if we try to read / write the file in the .NET code of the web application, then it will cause an error.
What are the possible approaches that I can use to access this file? I am not allowed to change the AppPool user in accordance with our company policy. If this was possible, then the code could access the file. In addition, I cannot change the permission of the file and allow it access to the \ User2 domain due to company policy.
What other option do I have?
Can I only run the read / write portion of a code file as Domain \ User2 through .NET code?
source
share