If you want to execute a portion of code in a différent sécurity context, you can use this class “Impersonate”.
Just create a instance in a using block.
using(new Impersonate(domain, user, password)){ //Code with different execution rights}
Download the class here : Impersonate.cs in zip
Under Windows Server 2003, you will prefer : WindowsIdentity.Impersonate()
Warning : an error 1314 can occured on Windows 2000 system : Read the note at the end of this article and read this articleYou can change the ‘Act as part of the operating system’ in :- From Administrative Tools, open Local Security Policy. If the Administrative Tools window is no longer open, navigate to Start > Settings > Control Panel> Administrative Tools> Local Security Policy.- Navigate to Security settings > Local Policies > User Rights Assignment- Double-click Act as part of the operating system under the policy column in the...
[More]
db57212f-9e49-47a5-8b2f-ff80bf6f8825|0|.0
.NET Projects, .NET Projects
.NET Projects, .NET Projects