Difference between revisions of "Ldapsearch"
Jump to navigation
Jump to search
(Created page with "``` ldapsearch # the command itself -LLL # just a particular way to display the results -H ldap://wspace.mydomain.com # the URL where the LDAP server listens -x # use simp...") |
|||
Line 25: | Line 25: | ||
− | + | ``` | |
+ | |||
+ | More | ||
+ | ``` | ||
+ | ldapsearch -H ldaps://wjv-dc03.extendhealth.com -x -W -D "jebusk@extendhealth.com" -b "dc=extendhealth,dc=com" 'objectClass=computer' name | ||
+ | ``` |
Revision as of 18:15, 31 August 2020
ldapsearch # the command itself -LLL # just a particular way to display the results -H ldap://wspace.mydomain.com # the URL where the LDAP server listens -x # use simple authentication, not SASL -D 'WSPACE\ENUMuser' # the account to use to authenticate to LDAP -w 'ENUMpass' # the password that goes with the account on the previous line -E pr=1000/noprompt # ask the server for all pages, don't stop after one -b 'ou=mydomain,dc=wspace,dc=mydomain,dc=com' # the base of the search. We don't want results from e.g. 'ou=blah,dc=wspace,dc=mydomain,dc=com' '(&(objectClass=person)(uidNumber=*))' # Ask for any entry that has attributes objectClass=person and uidNumber has a value SAMAccountName uid uidNumber # Show only these attributes List the bulk of machines: ldapsearch -LLL -H ldap://wspace.mydomain.com -x -D 'WSPACE\ENUMuser' -w 'ENUMpass' -E pr=1000/noprompt -b 'ou=computers,ou=mydomain,dc=wspace,dc=mydomain,dc=com' name|grep ^name: ... list a few more: ldapsearch -LLL -H ldap://wspace.mydomain.com -x -D 'WSPACE\ENUMuser' -w 'ENUMpass' -b 'cn=computers,dc=wspace,dc=mydomain,dc=com' ... and yet more: ldapsearch -LLL -H ldap://wspace.mydomain.com -x -D 'WSPACE\ENUMuser' -w 'ENUMpass' -b 'ou=extra workstations,ou=computers,ou=mydomain,dc=wspace,dc=mydomain,dc=com'
More
ldapsearch -H ldaps://wjv-dc03.extendhealth.com -x -W -D "jebusk@extendhealth.com" -b "dc=extendhealth,dc=com" 'objectClass=computer' name