Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

254
Views
ldapsearch: possible to include user attributes in the output/result even if the attribute is not set or null?

Dear stackoverflow community, time to ask my first (and maybe stupid) question here :)

I am facing the following problem at the moment and hope that maybe some of you can help me with this: for reasons, I have to query our Active-Directory to get some user data and write it into an CSV file on my Linux machine. For the query, I use the ldapsearch utility. Basically I was able to get this to work and query the user attributes i need. Now I'm facing the problem, that I have some users, that dont have one or more of the queried attributes set (e.g. "othertelephone"). In this case, ldapsearch does not include these empty attribute(s) in the output/result. Is there a possibility to include all queried attributes in the result/output, even if they are not set or empty? The reasons I need this, is to keep a uniform clean format of the output (to convert the output into CSV easily later on). So e.g. if Attribute "othertelephone" is empty, I want to have the output looks like that:

sn: abc
givenName: xyz
othertelephone: 
memberOf: blablabla

instead of

sn: abc
givenName: xyz
memberOf: blablabla

Sadly, I have not found any switch of the ldapsearch command with which I can achieve this. Is this even possible with ldapsearch or which other way can i go? I am thankful for every hint you can give to a beginner.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I know of no ldapsearch utilities that will return empty values.

However you can use Apache Studio and do the search and then copy table (icon in upper right) then pasting into text editor and achieve almost the same result.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!