Click here to Skip to main content
15,434,813 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We have a C# ASP.Net web app running on Windows/IIS 10. We also have an ISAPI Extension written in C++. I wrote the ISAPI Extension and someone else wrote the C# web page.

Both need to read files located on a different computer on the network.

The C# dev created a share on his computer and gave servername$ (the IIS server) full permission. The C# code is able to read a file but the ISAPI Extension cannot.

The App Pool Identity is the default ApplicationPoolIdentity. Assigning servername$ permissions is supposed to work. It appears to work for C#.

The ISAPI Extension hosts the runtime for the programming language PowerBuilder. We are using it to allow the web app to run reports written in PowerBuilder and display them as PDF in the browser. The file access that is failing is PowerBuilder code.

What I have tried:

I created a share on my computer and gave the IIS server full permission to the share. I run my ISAPI extension and it cannot access the file.
Posted
Updated 22-Sep-21 4:49am
v2

1 solution

It sounds like you gave the IIS server machine account permissions to the share (bad idea by the way) but did not give the ASP.NET account your app pool is using permissions to the share.

It's a better idea to create a user account, specifically for your application to use, and use that account in the app pool and give it permission to the share.
 
Share this answer
 
Comments
Roland M Smith 22-Sep-21 11:27am    
I've tried using my account on the app pool but that doesn't work. I think I saw somewhere that the account used on the app pool had to have elevated privileges on the other server. Is that correct?
Dave Kreskowiak 22-Sep-21 12:01pm     CRLF
No, not at all. You actually want to avoid elevated priv's because that would be a massive security risk. Your ISAPI extension does not run as part of your website, but as part of IIS itself. That runs under the local system (machine) account, which will not have any access to network resources. You've already given permissions to the machine account, so I don't know why it's not working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900