[brlug-general] ldap question

Dustin Puryear dustin at puryear-it.com
Thu Jan 25 22:28:42 CST 2007


And of course if you want to find everyone that doesn't have any email
address, you would do:

'(&(slucmsuid=*)(!(mail=*)))'

---
Puryear Information Technology, LLC
Baton Rouge, LA * 225-706-8414
http://www.puryear-it.com

Author:
  "Best Practices for Managing Linux and UNIX Servers"
  "Spam Fighting and Email Security in the 21st Century"

Download your free copies:
  http://www.puryear-it.com/publications.htm


Thursday, January 25, 2007, 8:07:53 PM, you wrote:

> Ray,

> You should be able to execute this query without the hassle:

> #!/bin/sh

> ldapsearch -h x.x.x.x -D cn=x,ou=y,o=z -w pass -x -b ou=y,o=z -s sub \
> '(slucmsuid=*)' -v mail slucmsuid


> If you are trying to gather email addresses and you are getting empty 
> email addresses try this:

> #!/bin/sh

> ldapsearch -h x.x.x.x -D cn=x,ou=y,o=z -w pass -x -b ou=y,o=z -s sub \
> '(&(slucmsuid=*)(mail=*))' -v mail slucmsuid



> Ronnie

> Puryear Information Technology, LLC
> Baton Rouge, LA * 225-706-8414
> http://www.puryear-it.com

> Visit http://www.puryear-it.com/publications.htm to download your free
> copies of:

>  "Best Practices for Managing Linux and UNIX Servers"
>  "Spam Fighting and Email Security in the 21st Century"



> -ray wrote:
>> Someone give me a hint on how to tell ldapsearch to NOT return attributes 
>> with NULL values, so i don't have to put this freaking ridiculous
>> script into production, hahaha.  Server is eDirectory, but don't wanna 
>> change anything there.
>>
>>
>> #!/bin/sh
>>
>>
>> ldapsearch -h x.x.x.x -D cn=x,ou=y,o=z -w pass -x -b ou=y,o=z -s sub \
>> '(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|(|
>> (slucmsuid=a*)
>> (slucmsuid=b*)
>> (slucmsuid=c*)
>> (slucmsuid=d*)
>> (slucmsuid=e*)
>> (slucmsuid=f*)
>> (slucmsuid=g*)
>> (slucmsuid=h*)
>> (slucmsuid=i*)
>> (slucmsuid=j*)
>> (slucmsuid=k*)
>> (slucmsuid=l*)
>> (slucmsuid=m*)
>> (slucmsuid=n*)
>> (slucmsuid=o*)
>> (slucmsuid=p*)
>> (slucmsuid=q*)
>> (slucmsuid=r*)
>> (slucmsuid=s*)
>> (slucmsuid=t*)
>> (slucmsuid=u*)
>> (slucmsuid=v*)
>> (slucmsuid=w*)
>> (slucmsuid=x*)
>> (slucmsuid=y*)
>> (slucmsuid=z*)
>> )))))))))))))))))))))))' \
>> -v mail -v slucmsuid
>>
>>   

> _______________________________________________
> General mailing list
> General at brlug.net
> http://mail.brlug.net/mailman/listinfo/general_brlug.net




More information about the General mailing list