Title: RE: NT & Exchange

Try using "\\\\PESSIMISM" as the string for your server.

Assuming the server is a PDC or a BDC, the fact that Exchange is also installed on the machine won't interfere with your ability to add or remove users from the SAM database.

Gary W. MacDonald

-----Original Message-----
From: Ben Walter [mailto:[EMAIL PROTECTED]]
Sent: Saturday, December 23, 2000 1:52 PM
To: Perl-Win32-Admin (E-mail); Perl-Win32-Web (E-mail)
Subject: NT & Exchange


Hi,

I posted this question ages ago and someone did send a suggestion, but I
can't seem to find it in the archives. :/

I have an NT machine with Exchange on it. I have a script that allows users
to join (adding an NT account) and a script that I have access to to delete
users. Unfortunately the adding and deleting of the user from the domain
don't work and I think it has to do with the exchange component. I need to
be able to add/delete the user to/from Exchange as well as setting variables
in their Exchange account. At the moment, I have the following subroutine to
add the user:

my($Server) = "PESSIMISM";
my($groupName) = "Domain Users";
my($Realname) = $fname . " " . $lname;
my($logscript) = $login . ".bat";
my(%Account) = (password => "$pass_a", homedir => "W:\\", priv =>
USER_PRIV_USER, flags => UF_SCRIPT | UF_NORMAL_ACCOUNT |
UF_DONT_EXPIRE_PASSWD | UF_PASSWD_CANT_CHANGE, comment  => "", logon =>
"$logscript",);
if (Win32::NetAdmin::UserCreate($Server, $login, $Account{password}, 0,
$Account{priv}, $Account{homedir}, $Account{comment}, $Account{flags},
$Account{logon})) {
    Win32::AdminMisc::UserSetMiscAttributes($Server, $login, USER_FULL_NAME
=> $Realname);
#    Win32::NetAdmin::GroupAddUsers($Server, $groupName, $login);
}

And to delete the user I have:

my($thisname) = @_;
Win32::NetAdmin::UserDelete("PESSIMISM", "$thisname");

Any help would be appreciated.

----------------------------------
Ben Walter

Email:  [EMAIL PROTECTED]
URL:    http://www.javabreak.gen.nz/
ICQ:     22830172 (Home)
            83592499 (Work)
Cell:    (021) 259 2718
 <<Ben Walter (E-mail).vcf>>

Reply via email to