Article
Problem
The Identity Manager AD driver matches against eDir users on the basis of the userprincipalname. However, this is an optional attribute that not all users (especially ones created before Windows 2003) have.
Solution
Here's a quick one-liner I whipped up in a few minutes for a customer. This will find all users in an Active Directory tree that don't have a UserPrincipalName, get their SamAccountName, build a UPN off of that, and inject the new UPN's into AD.
ldapsearch -xWZLLL -D "cn=Administrator,cn=users,dc=example,dc=com" -b "dc=example,dc=com" -h myserver.example.com '(&(objectclass=user)(!(userprincipalname=*)))' samaccountname | sed '/sAMAccountName/s/$/\@example\.com/g' | sed s/sAMAccountName/userPrincipalName/g | ldapmodify -xWZ -D "cn=Administrator,cn=users,dc=example,dc=com" -h myserver.example.com
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.
Related Articles
- Real-life Tips on Configuring Kerberos for Authentication in Access Manager
- Active Directory Driver and Setting Attributes in Active Directory
- Working with eDirectory Containers and Active Directory
- Using iChain to Protect a Sharepoint Site
- Managing multiple Active Directory domains in one IDM system - Part 5
User Comments
- Be the first to comment! To leave a comment you need to Login or Register
- 2896 reads


0