I am trying to adapt my commandline script to work from
a web page. The HTML code is this:

--SNIP--

<HTML>

<FORM METHOD="POST"
ACTION="http://adminweb.stage.mas.com.au/cgi-bin/find_user_web.pl";>
<INPUT TYPE="text" NAME="user" VALUE="">
<INPUT TYPE="submit" NAME="submit" VALUE="submit">
</FORM>

</HTML>

--SNIP--

The script is like this

--SNIP--

use Win32::NetAdmin;
use Win32::TieRegistry(Delimiter => "/");
use strict;
use CGI;


my $post = new CGI;

my $search_user = $post->param('user');

my $domain = Win32::DomainName;
my $error;
my $found_user_number = 0;
my $remotekey;
my $server;
my $username;
my @servers;

print $post->header;

if ($search_user eq ""){
print "\n Usage:\t \"perl find_user.pl username\" (Print location of
\"username\")\n";
print "         \"perl find_user.pl all\"      (Print location of all
users)";
exit(1);
}

print "For Domain: ",$domain,"\n\n";

 Win32::NetAdmin::GetServers( '', $domain, SV_TYPE_ALL, \@servers);

 foreach $server (@servers) {

 $remotekey = $Registry->Open("//$server/LMachine/SOFTWARE/Microsoft/Windows
NT/CurrentVersion/Winlogon", {Access => "KEY_READ"});
 ($username, $error) = $remotekey->GetValue('DefaultUserName');

 if (($search_user eq $username) or ($search_user eq "all")){
 print $domain,"\\",$username," is located on:","\t",$server,"\n";
 $found_user_number ++;
 }

 if ($error eq "0"){
 print "Could not read key value from server: ",$server,"\n";
 unlink $error;
 }

 }

 print "\nFound: ",$found_user_number," user(s).";
 exit(0);

--SNIP--

The output I get is like this:

--SNIP--

For Domain: MAS

--SNIP--

And then execution stops. Am I missing something?
The vars are passed correctly,
but it does not seem to hit the foreach..

Oh, and permissions for the IIS user are ok as well..

Regards,
Lorne



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to