[brlug-general] ldap question
Ronnie Gilkey
rgilkey at gmail.com
Thu Jan 25 20:07:53 CST 2007
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
>
>
More information about the General
mailing list