1

I'm using Novell in asp.net core 2.2 application to interact with AD. Following functions are working as expected.

  • Getting all users, Getting users from specific OU
  • Create an User
  • Update an User
  • Reset password and etc

But when i try to move the entry to new container it gives following exception

  • Naming Violation
  • ((Novell.Directory.Ldap.LdapException)e).LdapErrorMessage : "00000057: LdapErr: DSID-0C090E72, comment: Error in attribute conversion operation, data 0, v4563"

Here is the code block i'm using.

var dn = $"CN={user.FirstName} {user.LastName},{this._ldapSettings.ContainerName}"; 
    //dn => CN=arshath shameer,CN=Users,DC=wxyzdev,DC=xyzdev,DC=ca
var newRDn = $"CN={user.FirstName} {user.LastName},OU=DeletedUsers,DC=wxyzdev,DC=xyzdev,DC=ca";
    // newRDn =>  CN=arshath shameer,OU=DeletedUsers,DC=wxyzdev,DC=xyzdev,DC=ca

                using (var ldapConnection = this.GetConnection())
                {
                    //ldapConnection.Delete(dn);
                    ldapConnection.Rename(dn, newRDn, dn, true);
                }

I'm following this link.

Arshath Shameer
  • 453
  • 4
  • 15

2 Answers2

3

There are 2 issues to fix :

  • RDN means relative DN : the part in the DN that actually makes an entry distinguishable from others in the same container, for example : CN=arshath shameer in CN=arshath shameer,CN=Users,DC=wxyzdev,DC=xyzdev,DC=ca. In your case, since you don't want to rename but to move an entry, it doesn't change :

    var newRDn = $"CN={user.FirstName} {user.LastName}";
    
  • When moving an entry - contrary to renaming - the RDN stays the same, but the parentDN changes :

    var parentDN = "OU=DeletedUsers,DC=wxyzdev,DC=xyzdev,DC=ca";
    

Now let's move the entry :

ldapConnection.Rename(dn, newRDN, parentDN, true);

You may also need to check whether {this._ldapSettings.ContainerName} is replaced with CN=Users,DC=wxyzdev,DC=xyzdev,DC=ca to ensure dn variable is correctly set.

EricLavault
  • 12,130
  • 3
  • 23
  • 45
0



I had encountered this issue.
Having come across this thread from google, it was not clear to use "CN=arshath shameer".

Please use "CN=arshath shameer" instead of "CN=arshath shameer,CN=Users,DC=wxyzdev,DC=xyzdev,DC=ca" in the newRDN parameter.

Thanx.
FRS.