18.4. Log In to Another Account Programmatically
Problem
You want part of your code to execute under a different user account than that of the current user.
Solution
Log in to the new account with the unmanaged LogonUser function, and use the WindowsIdentity.Impersonate method.
You are currently reading a PREVIEW of this book.
Get instant access to over
$1 million worth of books and videos.
Start a Free Trial