Sometimes a script needs to log on as a different user—what is known as impersonation. Consider a Web CGI script that enables a user to modify her user account information (such as her full name) or to make modifications to her home directory. The script could accept the user’s userid and password as input parameters and attempt to log on as that user. If successful, the script could have access to files and directories to which only she has permission. Services use this feature quite often, such as Web servers and Telnet daemons.
The Win32::AdminMisc extension provides an impersonation function called LogonAsUser():
Win32::AdminMisc::LogonAsUser( $Domain, $User, $Password[, $LogonType ] );
The parameters for the LogonAsUser() ...