#!/bin/sh echo "##### anonymous" ldapsearch -LLL -v -x -b DC=company,DC=org -h 127.0.0.1 '(objectClass=inetOrgPerson)' > search-results-anonymous.ldif echo "##### rootdn" ldapsearch -LLL -v -x -b DC=company,DC=org -D CN=ldapmaster,DC=company,DC=org -w ldapsecret -h 127.0.0.1 '(&(objectClass=inetOrgPerson)(mail=*@*))' > search-results-rootdn-all.ldif echo "##### rootdn" ldapsearch -LLL -v -x -b OU=company.org,DC=company,DC=org -D CN=ldapmaster,DC=company,DC=org -w ldapsecret -h 127.0.0.1 '(&(objectClass=inetOrgPerson)(mail=*@*))' > search-results-rootdn-one-org.ldif echo "##### authorized user" ldapsearch -LLL -v -x -b DC=company,DC=org -D UID=postmaster@company.org,OU=users,OU=company.org,DC=company,DC=org -w qwerty -h 127.0.0.1 '(&(objectClass=inetOrgPerson)(mail=*@*))' > search-results-auth-all.ldif echo "##### authorized user" ldapsearch -LLL -v -x -b OU=company.org,DC=company,DC=org -D UID=postmaster@company.org,OU=users,OU=company.org,DC=company,DC=org -w qwerty -h 127.0.0.1 '(&(objectClass=inetOrgPerson)(mail=*@*))' > search-results-auth-oneorg.ldif