use Win32::API; ############################################################## # Add cleanup before using this in production Win32::API->Import('advapi32', 'int LogonUser( LPTSTR lpszUsername, LPTSTR lpszDomain, LPTSTR, lpszPassword, DWORD dwLogon, DWORD dwLogonProvider, PHANDLE phToken )' ) or die "Win32::API->import for LogonUser failed: $^E"; my $ph = ' ' x 4; # Required, but we do not use it #############################################################