LDAP filter to find unused attributes

from LDAP I'd like to determine which attributes are unused, I want to find entries where the attributes are present but are unused or has a null value (i.e. an empty/blank string).

Can I do this using an LDAP filter (ldapsearch), and if so, how?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike KlineCommented:
You can use an LDAP filter to search for attributes if you know the attribute so for example if you want to search for all users that have their phone number populated (or not) you can do that.

You can also dump all the information using something like csvde

csvde -f addump.csv



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ralph_reaAuthor Commented:
I'd like to search the attribute (i.e. phone number) that have null value for all users, which sintax must I use?

my O.S. is linux, how can I dump all the information?
Mike KlineCommented:
I know how to do it in AD but added the Linux topic so those guys can help.


The 7 Worst Nightmares of a Sysadmin

Fear not! To defend your business’ IT systems we’re going to shine a light on the seven most sinister terrors that haunt sysadmins. That way you can be sure there’s nothing in your stack waiting to go bump in the night.

ralph_reaAuthor Commented:
How can I do in AD?
I'd like to dump the list of all users  and all attributes.
ralph_reaAuthor Commented:
I tried this for list of all users:

ldapsearch -h myhost -p 3060 -D "cn=orcladmin" -w password -b dc=gca,dc=net "(&(uid=*))" -L dn attrthatnotexist >> list_all_users.ldif

but I get all user with






How can I do it for all attributes?
Mike KlineCommented:
So in the AD example you want to see every user that doesn't have the telephone number attribute populated?

In your example above you are just searching for any object that has uid populated


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.