Question

I'm attempting to write a text file using Streamwriter (C#, Asp.Net, IIS 7.5 on Win server 2008 64-bit) and the file does not get written to or created, apparently due to a permissions issue.

The app pool is running under NetworkService, and the location it is writing to is on a different machine than the IIS servers (load-balanced IIS farm using virtual file server).

I've verified that the path I'm writing to on the fileserver is correct in the code, and if I map a network share from the ISS server(s) to that fileserver, right-click on the target folder, the local Network Service account shows Full Control on that folder.

Can anyone offer a possible reason this would not work? Thanks, James

Was it helpful?

Solution 2

If the folder is on another machine and if you have not enabled delegation it will fail, this is because when you hop from one resource to another indirectly (web or otherwise) an extra layer of protection exists in AD, so source resource(web server) need delegation rights to the destination resource (in this case share) see this http://blogs.technet.com/b/askds/archive/2008/06/13/understanding-kerberos-double-hop.aspx

OTHER TIPS

go into IIS and right click on your application pool and click advanced settings

if you see this:

enter image description here

then your user name that needs permissions is IIS APPPOOL/[pool name here should match the website name in IIS]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top