How can I rename a shortname in OpenLDAP on OS X Server 10.6 (Invalid DN syntax (34))

The company I work for is running OS X Server 10.6. All of the users were created with a first.last username syntax. This is causing problems and so we are trying to change the usernames to firstlast without deleting and recreating all of the user accounts. I found the following example command:

serveradmin$ ldapmodrdn -U diradmin -Y “cram-md5″ -W -r “uid=first.last,cn=users,dc=my,dc=domain,dc=com” “uid=firstlast”

Here is the result:

Enter LDAP Password: 
SASL/CRAM-MD5 authentication started
SASL username: diradmin
SASL SSF: 0
Rename Result: Invalid DN syntax (34)
Additional info: invalid DN

serveradmin$ 

Does anyone know of a way to rename my users in a non-destructive way? Can anyone tell me how to solve the Invalid DN syntax problem? Any help is much appreciated.

Answer

You need to use dscl command to change a short name and there is not only one occurrence in the OD record. Check this link for sample:
http://www.kelleycomputing.net/downloads/changeShortName.command

Attribution
Source : Link , Question Author : David , Answer Author : BobC

Leave a Comment