Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

What modules are recommended for logging into a win2k server as a specific user?

by 2501 (Pilgrim)
on Dec 28, 2000 at 02:14 UTC ( [id://48541]=perlquestion: print w/replies, xml ) Need Help??

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")

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://48541]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-24 11:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found