in reply to Remote Win32 User
I think you are looking for Win32::NetResource
Code Snippet:
you can noe check on $NetResource{LocalName} for the file you want.my $localdrive = "x:/"; my $RemoteName = "\\\\RemoteSrv\\RemoteShare"; %NetResource = ( LocalName => "$localdrive", RemoteName => "$RemoteName"); my $User = "User"; my $Password = "Password"; if ( Win32::NetResource::AddConnection( \%NetResource, $Pa +ssword, $User, 0) ) { print "Connection Successful!\n"; } else { print "Connection Failed: $^E \n"; }
You are effectively mapping a drive to a remote share with specified credentials.
Update: You can put this code into a win32 service which starts as any user and connect with the local user from the remote machine. (You might need to put the machine name that you are connecting to in front of the remote username ie. remotemachine\remoteuser..)
Update2: You will need to have NetBIOS (I think) access through the firewall.. basically if you can map a drive from the machine with perl to the remote machine, you can use the above code..;)
-----Of all the things I've lost in my life, its my mind I miss the most.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Remote Win32 User
by tos (Deacon) on Nov 18, 2003 at 11:01 UTC | |
Re: Re: Remote Win32 User
by nimdokk (Vicar) on Nov 14, 2003 at 15:48 UTC |
In Section
Seekers of Perl Wisdom