I assume that you are using ADsI with the WinNT provider. That is definitely
preferable to using any of the Perl admin modules. Here is an example of
setting the password to never expire.
use Win32::OLE;
use Win32::OLE::Const("Active DS Type Library");
my $adsUser = Win32::OLE->GetObject("WinNT://DOMAIN/UserName,User");
die Win32::OLE->LastError if Win32::OLE->LastError;
$adsUser->{UserFlags} = $adsUser->{UserFlags} | ADS_UF_DONTEXPIREPASSWD;
$adsUser->SetInfo;
die Win32::OLE->LastError if Win32::OLE->LastError;
sub ADS_UF_DONTEXPIREPASSWD {(0x10000);}
Hope this helps,
John
-----Original Message-----
From: Jeroen Bakker [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 28, 2001 6:29 AM
To: [EMAIL PROTECTED]
Subject: Creating NT accounts
Hi,
I'm currently writing a script that, among other things, should create an
NT user account. Most if it seems to work just fine, but i'm experiencing
problems trying to set the following flags (using Win32:OLE):
UserCannotChangePassword
PasswordNeverExpires
Executing the script returns an error saying that the member wasn't found.
Perhaps I got the names wrong (after a long search and lots of attempts
this was what i came up with) or maybe it just isn't supported. I'm using
Win32:OLE version 0.1501. Do i have the names wrong? If so, what are they
(or, where can i find them)? Or am i doing something fundamentally wrong?
Thanks in advance,
Jeroen Bakker
------------------+--------------------------------+-------------------
Jeroen Bakker | Cysonet Engineering | [EMAIL PROTECTED]
phone 020-4703339 | The magic behind the buzzwords | fax 020-4270604
------------------+--------------------------------+-------------------
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin