Now that I'm binding ok, I'm trying to create a user but running into
additional problems.
I'm running into this error:
failed to add entry: 00000057: LdapErr: DSID-0C090B38, comment: Error in
attribute conversion operation, data 0, vece at ./create.pl line 36.
Thoughts?
#!/usr/bin/perl
use Net::LDAP;
use Unicode::Map8;
my $binduserid = "cn=myuser";
my $bindPass = "supersecretpassword";
my $ldapServer = "ldaps://ad.myorg.edu";
$ldap = Net::LDAP->new ( $ldapServer ) or die "$@";
$ldap->bind($binduserid, password =>$bindPass);
my $firstname = "John";
my $lastname = "Doe";
my $uid = "jdoe1234";
my $password = "123456";
my $fullname = "$firstname $lastname";
my $charmap = Unicode::Map8->new('latin1') or die $!;
my $unipwd = $charmap->tou(qq{"$password"})->byteswap()->utf16();
my $result = $ldap->add (
dn => "ou=my guest
accounts,ou=subou,ou=myou,dc=ad,dc=myorg,dc=edu",
attr => [ 'objectclass' =>
['user','person','organizationalPerson','top'],
'sn' => $last,
'givenName' => $first,
'samAccountName' => $uid,
'userPrincipalName' => $uid,
'displayeName' => $fullname,
'unicodePwd' => $unipwd,
]
);
$result->code && die "failed to add entry: ", $result->error ;
$ldap->unbind;