Method | Description | |
---|---|---|
Dispose ( ) : void | ||
Impersonator ( string userName, string domainName, string password ) : System |
Constructor. Starts the impersonation with the given credentials. Please note that the account that instantiates the Impersonator class needs to have the 'Act as part of operating system' privilege set.
|
Method | Description | |
---|---|---|
CloseHandle ( |
||
DuplicateToken ( |
||
ImpersonateValidUser ( string userName, string domain, string password ) : void |
Does the actual impersonation.
|
|
LogonUser ( string lpszUserName, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, |
||
RevertToSelf ( ) : bool | ||
UndoImpersonation ( ) : void |
Reverts the impersonation.
|
public Impersonator ( string userName, string domainName, string password ) : System | ||
userName | string | The name of the user to act as. |
domainName | string | The domain name of the user to act as. |
password | string | The password of the user to act as. |
return | System |