2501 has asked for the wisdom of the Perl Monks concerning the following question:

Win32::AuthenticateUser documentation and a search for some example code did not leave me with a warm fuzzy feeling.
I need to log into a win2k server as a specific user. Creating shares is not an option.
thanks for your time,
2501
  • Comment on What modules are recommended for logging into a win2k server as a specific user?

Replies are listed 'Best First'.
(tye)Re: What modules are recommended for logging into a win2k server as a specific user?
by tye (Sage) on Dec 28, 2000 at 03:17 UTC

    Win32::AuthenticateUser is for impersonating someone else when you are already running on a machine. Your description makes me think you are instead trying to remotely authenticate to a server, which can be done like so:

    use Win32::NetResource qw( AddConnection CancelConnection ); # ... my $mach= "www.microsoft.com"; my $username= "microsoft\\administrator"; my $password= "b1gd0g"; my $netResource= "\\\\$mach\\IPC\$"; if( ! AddConnection( { Scope=>0, Type=>0, DisplayType=>0, Usage=>0, LocalName=>"", RemoteName=>$netResource, Comment=>"", Provider=>"" }, $password, $username, 0 ) ) { warn "\nCan't connect to $mach: $^E\n"; return; }
    which shows some room for improvement of the Win32::NetResource module. (:

            - tye (but my friends call me "Tye")