I have impersonated a thread with success. What I would like to do is either keep the impersonation to that thread (the impersonation must not be inherited) or if I can specify somewhere that a certain class can't be impersonated.
In my example I am watching a folder with the filesystemwatcher. I need certain credentials for that folder. The filesystemwatcher is running during the lifetime of the app. I have other functions that are called when the filesystemwatcher triggers (from the filesystemwatcher). I want those threads to run as the original user (local system account).
How can I perform and control this behaviour?
Thanks!
In my example I am watching a folder with the filesystemwatcher. I need certain credentials for that folder. The filesystemwatcher is running during the lifetime of the app. I have other functions that are called when the filesystemwatcher triggers (from the filesystemwatcher). I want those threads to run as the original user (local system account).
How can I perform and control this behaviour?
Thanks!