Hello everyone.
I'm trying to create a user under Active Directory using NET::LDAP. I'd
like to set its country (to France for example) but I got this error
message :
00002082: AtrErr: DSID-0315109A, #1: 0: 00002082: DSID-0315109A, problem
1005 (CONSTRAINT_ATT_TYPE), data 0, Att 6 (c):len 12
Here's a snippet of the code I'm using :
my $newentry = Net::LDAP::Entry->new;
my $dn="ou=Users,ou=rahtest,dc=RECETTE,dc=REC,dc=NET";
$newentry->dn("cn=$login,$dn");
$newentry->add('cn'
=> "$login");
$newentry->add('displayName'
=> "$nom $prenom");
$newentry->add('sn'
=> "$nom");
$newentry->add('sAMAccountName'
=> "$login");
$newentry->add('userPrincipalName'
=> "$login");
$newentry->add('givenName'
=> "$prenom");
$newentry->add('userAccountControl'
=> '544');
$newentry->add('objectclass'
=> 'user');
if ($adresse ne ""){$newentry->add('streetAddress'
=> "$adresse");}
if ($ville ne ""){$newentry->add('l'
=> "$ville");}
if ($codepostal ne ""){$newentry->add('postalCode'
=> "$codepostal");}
Here is how I try to set the country
if ($pays ne ""){$newentry->add('c'
=> "France");}
if ($titre ne ""){$newentry->add('title'
=> "$titre");}
if ($compagnie ne ""){$newentry->add('company'
=> "$compagnie");}
if ($departement ne ""){$newentry->add('department'
=> "$departement");}
if ($phonebusiness ne ""){$newentry->add('telephoneNumber'
=> "$phonebusiness");}
if ($adresseemail ne ""){$newentry->add('mail'
=> "$adresseemail");}
if ($bureau ne
""){$newentry->add('physicalDeliveryOfficeName' => "$bureau");}
if ($commentaire ne ""){$newentry->add('description'
=> "$commentaire");}
my $mesg = $ldaptest->add($newentry);
$newentry->update($ldaptest);
I also tried the following :
if ($pays ne ""){$newentry->add('co'
=> "France");}
And when I do that, I have no error when I create the user, but when I
check in AD in its "Address" Property Sheet, there is no value in the
Country/Region label.
Thank you for your help...
Robert-Alexandre Hollinger