ldapsearch
Query an LDAP directory. tldr-pages
On several platforms
Several platforms
Query an LDAP server for all items that are a member of the given group and return the object's displayName value
ldapsearch --bindDN 'admin_DN' --bindPassword 'password' --hostname ldap_host --baseDN base_ou 'memberOf=group1' displayNameIdentifyQuery an LDAP server with a no-newline password file for all items that are a member of the given group and return the object's displayName value
ldapsearch --bindDN 'admin_DN' --keyStorePasswordFile 'password_file' --hostname ldap_host --baseDN base_ou 'memberOf=group1' displayNameIdentifyReturn 5 items that match the given filter
ldapsearch --bindDN 'admin_DN' --bindPassword 'password' --hostname ldap_host --baseDN base_ou 'memberOf=group1' --sizeLimit 5 displayNameIdentifyWait up to 7 seconds for a response
ldapsearch --bindDN 'admin_DN' --bindPassword 'password' --hostname ldap_host --baseDN base_ou 'memberOf=group1' --timeLimitSeconds 7 displayNameIdentifyInvert the filter
ldapsearch --bindDN 'admin_DN' --bindPassword 'password' --hostname ldap_host --baseDN base_ou '(!(memberOf=group1))' displayNameIdentifyReturn all items that are part of multiple groups, returning the display name for each item
ldapsearch --bindDN 'admin_DN' --bindPassword 'password' --hostname ldap_host '(&(memberOf=group1)(memberOf=group2)(memberOf=group3))' "displayName"IdentifyReturn all items that are members of at least 1 of the specified groups
ldapsearch --bindDN 'admin_DN' --bindPassword 'password' --hostname ldap_host '(|(memberOf=group1)(memberOf=group1)(memberOf=group3))' displayNameIdentifyCombine multiple boolean logic filters
ldapsearch --bindDN 'admin_DN' --bindPassword 'password' --hostname ldap_host '(&(memberOf=group1)(memberOf=group2)(!(memberOf=group3)))' displayNameIdentify