LDAP tools snippets
// Lookup SAM account name in AD
# ldapsearch -b 'DC=racktoplabs,DC=com' -h 10.1.18.1 -D 'CN=Sam Zaydel,OU=Users,OU=Corp,DC=racktoplabs,DC=com' 'sAMAccountName=szaydel'
// Limit search to person(s), filtering for common name 'Sam Zaydel' and request only the msSFU30Name attribute
# ldapsearch -b 'DC=racktoplabs,DC=com' -h 10.1.18.1 -D 'CN=Sam Zaydel,OU=Users,OU=Corp,DC=racktoplabs,DC=com' -s sub '(&(objectclass=person)(cn=Sam Zaydel))' msSFU30Name
// Limit search to person(s), filtering for common name 'Sam Zaydel' and request msSFU30Name and unixUserPassword attributes
# ldapsearch -b 'DC=racktoplabs,DC=com' -h 10.1.18.1 -D 'CN=Sam Zaydel,OU=Users,OU=Corp,DC=racktoplabs,DC=com' -s sub '(&(objectclass=person)(cn=Sam Zaydel))' msSFU30Name unixUserPassword
// Limit search to group(s), filtering for common name 'Domain Users'
# ldapsearch -b 'DC=racktoplabs,DC=com' -h 10.1.18.1 -D 'CN=Sam Zaydel,OU=Users,OU=Corp,DC=racktoplabs,DC=com' -s sub '(&(objectclass=group)(cn=Domain Users))'