views:

99

answers:

2

We have a web farm and are writing temp files for reports. We set up a file share and are using impersonation to write the temporary report files to that share. We gave the account doing the impersonation full control to the share and the folder itself.

The files are writing correctly but are not being deleted. Is there something we're missing with this setup?

+1  A: 

Not sure what method you are using to write the files. The following is what I ended up doing in order to read files. Maybe you could try this method for deleting them as well.

http://stackoverflow.com/questions/879704/how-can-i-temporarily-impersonate-a-user-to-open-a-file

Even Mien
A: 

Look at the "access denied" error event in Event Viewer and double-check that the user you expect to be doing the deletion is the actual user.

Bryan