Why don't you use something like: $result =
Win32::NetAdmin::UserCreate
  ( $server, $username, $password, $passwordage, $privilege, $userhomedir, $group, 
$flags, $scriptpath) 
  && print "Account Created Successfully";

        You can shell out to the command-line the way you're trying to do
but you have less control than using NetAdmin - if you're going to shell
out you would probably at least want to use IPC::Open3 to control input
and output to the process.

On Thu, 22 Jan 2004, Arun Budhwani wrote:

> I am having problems adding users to a global group.
> below is my code. My environmnet is NT4 Domain. Any
> feed abck would be greatly appreciated.
> 
> se Win32::NetAdmin;
> use strict;
> 
> my $cwid1 = "";
> 
> my $group= "";
> 
> my $server = "";                        
> 
> my $domain1="";
> 
> my $user="";
> 
> my $passwd="";
> 
> 
> `net use  \\\\$server /user:$domain1$user $passwd`;
> 
> Win32::NetAdmin::GroupIsMember($server,$group,$cwid1);
>     my $gle = Win32::GetLastError();
>       if ($gle) {
>               print "\nAdding $cwid1 to group $group
> failed.".(Win32::FormatMessage($gle))."\n";
>       } else {
>               print "\nSUCCESS for $cwid1 to $group\n";
>       }
> 
> of course all the scalars have values which I removed.
> The error message I get is "verlapped I/O operation is
> in progress". 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!
> http://webhosting.yahoo.com/ps/sb/
> _______________________________________________
> Perl-Win32-Admin mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

-- 
  Clint Mahoney
  The Herald-Times
  http://clintmahoney.com
  (812) 331-4236


_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to