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.
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 shameerinCN=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 :When moving an entry - contrary to renaming - the RDN stays the same, but the parentDN changes :
Now let's move the entry :
You may also need to check whether
{this._ldapSettings.ContainerName}is replaced withCN=Users,DC=wxyzdev,DC=xyzdev,DC=cato ensurednvariable is correctly set.