If Brian's fix doesn't work, there "may" be a problem in your site.

Can you create accounts, disable, and undisable an account manually?  I'm
guessing that it wouldn't work manually, if the article below pertains to
you.  (and granted, it's not a KB article specific to your situation, but
the error's the same, and the fix may be similar).

There's only a few references to 0x80072035 on google (and most of them are
in Japanese, which I can't read), but this article suggests that it may have
to do with connecting to a Global Catalog server..

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q282520

Hope this helps.

P.S. if you set all the other stuff, and then set the userAccountControl,
and then set again, does it work?

i.e.

$shadow->Put("whatever","whatever");
$shadow->Put("whatever","whatever");
$shadow->Put("whatever","whatever");
$shadow->SetInfo();
if (Win32::OLE->LastError() != 0) {  print "Nope - Before\n"; }
$shadow->Put("userAccountControl",512);
$shadow->SetInfo();
if (Win32::OLE->LastError() != 0) {  print "Nope - After\n"; }

Hope this helps.

Steven

-----Original Message-----
From: Chris Perry [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 04, 2003 10:23 AM
To: [EMAIL PROTECTED]
Subject: Problem with User Creation script in Active Directory using
Win32::OLE


I am getting the following error when I run the script down below.

"Error: Failed to set the user properties
        The error code was [-2147016651]
        The error text was [Win32::OLE(0.1601) error 0x80072035: "The server
is unwilling to process the request" in METHOD/PROPERTYGET "SetInfo"]"

I have narrowed it down to the line that reads:

        $shadow->Put ("userAccountControl", 512);

If I comment that line out, I no longer get the error message, the Account
is created, but the Account is disabled.  Any ideas on what I'm doing wrong?

Thanks,
Chris


$User_ADS_Path = "LDAP://$Mail_Server/$Container,$Domain_Naming_Context";;
$dso = Win32::OLE->GetObject("LDAP:");
$ou = $dso->OpenDSObject("$User_ADS_Path", "$Admin", "$Password", 1); #$dso
= Win32::OLE->GetObject($User_ADS_Path);
if (Win32::OLE->LastError != 0)
{
        print "Error: Failed to connect to container $User_ADS_Path\n";
        print "\tThe error code was [" . (0 + Win32::OLE->LastError) .
"]\n";
        print "\tThe error text was [" . Win32::OLE->LastError . "]\n";
        die;
}
#Create the user
$shadow = $ou->Create("User", "CN=$Full_Name");
$shadow->Put ("samAccountName", "$User_Name");
$shadow->Put ("userPrincipalName" , "[EMAIL PROTECTED]"); $shadow->Put
("displayName", "$Full_Name"); $shadow->Put ("givenName", "$First_Name");
$shadow->Put ("initials", "$Middle_Initial"); $shadow->Put ("sn",
"$Last_Name"); $shadow->Put ("homeDirectory", "$Home_Directory");
$shadow->Put ("homeDrive", "H:"); $shadow->Put ("scriptPath",
"storeprof.bat"); $shadow->Put ("description", "$Description"); $shadow->Put
("userAccountControl", 512); $shadow->SetPassword("$User_Password");
$shadow->SetInfo();
if (Win32::OLE->LastError != 0)
{
        print "Error: Failed to set the user properties\n";
        print "\tThe error code was [" . (0 + Win32::OLE->LastError) .
"]\n";
        print "\tThe error text was [" . Win32::OLE->LastError . "]\n";
        die;
}
_______________________________________________
Perl-Win32-Admin mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to