Used to dynamically modify the current windows user with the specified user
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As Impersonation
Dim userName As String
Dim password As String
Dim domain As String
Dim value As Boolean
value = instance.Impersonate(userName, password, domain) |
Parameters
- userName
- String value that specifies the name of the user. This is the name of the user account to log on to. If you use the UPN format, user@DNS_domain_name, the Domain parameter must be NULL.
- password
- String that specifies the clear-text password for the user account specified by Username
- domain
- String value that specifies the name of the domain or server whose account database contains the UserName account. If this parameter is NULL, the user name must be specified in UPN format. If this parameter is ".", the function validates the account using only the local account database.
Return Value
True if success, false if failed
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also