Method | Description | |
---|---|---|
impersonate ( string userName, string password, string domain, Action action, int logonType = 2, int logonProvider ) : void |
impersonates a user based on username/password provided. executed method after impersonation and then reverts impersonation when task/method is complete.
|
public static impersonate ( string userName, string password, string domain, Action action, int logonType = 2, int logonProvider ) : void | ||
userName | string | username to impersonate |
password | string | password for user account |
domain | string | domain of user to impersonate |
action | Action | method to invoke after impersonation |
logonType | int | LogonType to use, defaulted to Network |
logonProvider | int | LogonProvider type, defaulted to default |
return | void |