Novell is now a part of Micro Focus

Changing Up Your Directory Info

Novell Cool Solutions: Trench

Digg This - Slashdot This

Posted: 22 Aug 2002

The Question:
Our account creation policy generates accounts that follow this syntax: "LastNameFirstInitial" (ie WilliamsT for Tennessee Williams). We are very interested in being able to use a global employee ID number as a login attribute, but don't want to change a bunch of accounts nor do we want to make it difficult to create groups and such.

Is there something like a "nickname" that can be used as an authentication rather than the common name (CN=)?

The Answer:
You can use an LDIF file to rename all of your users to the new naming convention. it sounds hard but it's pretty easy. First extract the DN and the workforceID using the following LDAP command:

ldapsearch -h hostname -D cn=admin,o=novell -w password -LLL
objectclass=user workforceID >c:\temp\usernames.txt

That will give you a file that looks something like this:

# CARYL910,Users,kibco
dn: cn=CARYL910,ou=Users,o=kibco
workforceID: 12345
# CARYL9,Users,kibco
dn: cn=CARYL9,ou=Users,o=kibco
workforceID: 12346

Then using Textpad or some other editor that supports regular expressions you do a search and replace searching for workforceID: and replacing with changetype: modrdn\nnewrdn:

The resulting file should look something like this:

# CARYL910,Users,kibco
dn: cn=CARYL910,ou=Users,o=kibco
changetype: modrdn
newrdn: 12345
# CARYL9,Users,kibco
dn: cn=CARYL9,ou=Users,o=kibco
changetype: modrdnnewrdn: 12346

Now pump that through ICE or LDAPModify as such and your objects will all be renamed.

ldapmodify -h hostname -D cn=admin,o=novell -w password -c -f

Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions.

© Copyright Micro Focus or one of its affiliates