displayeName should read displayName.
Regards,
Daniel
John Arends schrieb:
Thanks for the suggestions so far but I'm still not having any luck. I
cleaned up the script a bit based on several of the suggestions.
I decided to take the password bit out for now. I can't create an
account with no password, so I'm setting userAccountControl to 514 so
the account will be created disabled. If I can create a disabled
account, I can worry about enabling it and setting a password later.
Everything looks right to me, but I'm still getting this error:
failed to add entry: 00000057: LdapErr: DSID-0C090B38, comment: Error in
attribute conversion operation, data 0, vece at ./create.pl line 36.
---
#!/usr/bin/perl
use Net::LDAP;
use Unicode::Map8;
use strict;
my $binduserid = "cn=myusername,DC=ad,DC=myorg,DC=edu";
my $bindPass = "password";
my $ldapServer = "ldaps://ad.myorg.edu";
my $ldap = Net::LDAP->new ( $ldapServer ) or die "$@";
$ldap->bind($binduserid, password =>$bindPass);
my $firstname = "John";
my $lastname = "Doe";
my $uid = "acf01234";
my $password = "123456";
my $fullname = "$firstname $lastname";
my $result = $ldap->add (
dn => "ou=my guest
accounts,ou=subOU,ou=myOU,dc=ad,dc=myorg,dc=edu",
attr => [ 'sn' => $lastname,
'userAccountControl' => "514",
'givenName' => $firstname,
'samAccountName' => $uid,
'userPrincipalName' => $uid,
'displayeName' => $fullname,
'objectclass' => ['top', 'person',
'organizationalPerson',
'user' ],
]
);
$result->code && die "failed to add entry: ", $result->error ;
$ldap->unbind;