[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-admin
Subject:    Re: AW: setting USER and PASSWORD in NetBios Operations
From:       StoneBeat <stonebeat () ya ! com>
Date:       2003-08-21 10:14:51
[Download RAW message or body]

Thanks for the answer but my problem is about add share in the remote host not 
connect to a share. sorry if my English is bad. I want execute Netbios 
operations in remote hosts using arbitrary login and password . Here is 
another example:


#########################
use Win32::NetAdmin  ;

Win32::NetAdmin::UserChangePassword("172.17.4.214", "administrator", "123456", 
"qwerty") ;


#########################

As you can see this script updates de Administrator password on 172.17.4.214. 
If my own machine have the same password than 172.17.4.214 the script works 
fine but if my local Administrator password is different the i get the error 
"access deny". My question is about to set the user and password in the perl 
script 

> Hi,
>
> try the Win32::Lanman functions.
>
> -- snip --
> #!c:\perl\bin\perl.exe
>
> use Win32::Lanman;
>
>
> $info{type} = &RESOURCETYPE_ANY;
> $info{remotename} = "\\\\192.168.2.10\\ipc\$";
> $info{username} = "MYSERVER\\AdminUser";
> $info{password} = "mypassword";
> $info{flags} = &CONNECT_UPDATE_PROFILE;
>
> print "Connection to $info{remotename}\n";
>
> if(!Win32::Lanman::WNetAddConnection(\%info)) {
> 	print " cannot created! Error: ";
> 	# get the error code
> 	print Win32::Lanman::GetLastError();
> } else {
> 	print " successfull created, showing administrative dir c:\n";
> 	@remote_c = `dir \\\\192.168.2.101\\c\$`;
> 	foreach $file (@remote_c) {
> 		chomp $file;
> 		print "$file\n";
> 	}
> }
> -- snap --
>
>
>
> regards
> Michael Wrzesinski
>
> --
> ** Michael Wrzesinski, technical consultant
> ** IBEX AG (www.ibex-ag.de)
> ** GS Berlin, Alt Moabit 91, 10559 Berlin, Germany
> ** phon:  0049 30 390810-28
> ** mobil: 0049 151 12016040
>
>
>
> _______________________________________________
> Perl-Win32-Admin mailing list
> Perl-Win32-Admin@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic