I'm impersonating a user until Windows 2008 with UAC enabled. I'm trying to write some files to a temp directory. But even if a user has write access to a directory, when I impersonate that user, I'm unable to write to that directory (I get an Access Denied error). Apparently, this is due to UAC blocking me.
This is related to a post on a microsoft forum: http://forums.iis.net/t/1149793.aspx But that forum got no response other than a microsoft employee repeatedly asking the same question and being silent when he got the info he asked for.
I've been able to get around this by not impersonating while writing to the temp file, but I have a few questions:
Why does UAC not allow writing to files when impersonated?
Is there any place I can put temp files while impersonated?
Is there some better solution? What's the "right" way to handle this?
Is there a source of documentation for what all the restrictions are for UAC & impersonated users?