I am trying to use Net::LDAP to manipulate AD.  I can find, modify, & delete 
entries but have trouble creating them.  All the examples that I have found 
online use Win32::OLE.  How can I do this with Net::LDAP?  Here is the code 
that I am using:

   my $ADS_UF_NORMAL_ACCOUNT = 512;
   my $entry = Net::LDAP::Entry->new;
   $entry->dn("CN=test_create,CN=Users,DC=usadir,DC=usa,DC=usouthal,DC=edu");
        $entry->add(
                'cn' => 'test_create',
                'sAMAccountName' => 'test_create',
                'userAccountControl' => $ADS_UF_NORMAL_ACCOUNT,
                'givenName' => 'john',
                'sn' => 'test_create',
                'displayName' => 'john test_create',
                'userPrincipalName' => '[EMAIL PROTECTED]',
                'userPassword' => '99RedBal',
        );
   my $results = $entry->update( $ldap );
   $results->code &&
      die "create failed:" . $results->error ;

This is the error I get when I run it:

create failed:0000207B: UpdErr: DSID-03050FB6, problem 6002 
(OBJ_CLASS_VIOLATION), data 0

Also, what are some good online resources for the AD/perl combination?

Thanks in advance for any help,
-ch

-----------------------------------
Chris Heath
Academic Computing
460-7912
[EMAIL PROTECTED]


Reply via email to