I've worked with it, and i can tell you one problem right from a glance:

you have to single quote '\\\\server'
else it'll blow up in your face

hth,

Jos Boumans


----- Original Message -----
From: "Meidling, Keith" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 22, 2001 12:10 AM
Subject: Problems with Win32::NetAdmin


> I'm having some trouble creating users with Win32::Netadmin.
>
> I don't know if it's just me, but it seems that the documentation is less
> than worthless...
>
> If anyone has created a user via this module, I would appreciate it very
> much if you could help me out.
>
> I have tried to leave out some of the settings in the UserCreate function,
I
> have tried to set them to some other value. Nothing seems to work.
>
> This is the code that I'm working with.. I figured I could copy settings
> from one user to another. Didn't work. I have tried to set the password
age
> to 0, I have tried doing double quotes "" for some sections. The code
below,
> will go to the machine, and pull the user information. I would like to
know
> how I can create it. The account I'm running the script under (on my own
> machine) has admin privs on the box that I'm trying to create the user on.
>
> Both boxes are Windows 2000 Advanced Servers.
>
> #!/user/bin/perl
> # adduser.plx
> use strict;
> use warnings;
> use Win32::NetAdmin qw(UserGetAttributes UserCreate);
>
> my $server="\\\\server";
> my $user1="user1";
> my $user2="user2";
> my $pass="12345678";
> my
>
($username,$password,$passwordage,$privilege,$homedir,$comment,$flags,$scrip
> tpath,$result);
>
> print "I'll be copying from useraccount $user1 to create $user2\n\n";
>
>
UserGetAttributes($server,$user1,$password,$passwordage,$privilege,$homedir,
> $comment,$flags,$scriptpath);
>
> print "Server - ",$server,"\n";
> print "Username - ",$user1,"\n";
> print "passwordage - ",$passwordage,"\n";
> print "privilege - ",$privilege,"\n";
> print "homedir - ",$homedir,"\n";
> print "comment - ",$comment,"\n";
> print "flags - ",$flags,"\n";
> print "scriptpath - ",$scriptpath,"\n";
>
> $result =
>
UserCreate($server,$user2,$pass,$passwordage,$privilege,$homedir,$comment,$f
> lags,$scriptpath);
>
> print $result;
>
>

Reply via email to