Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
Created May 15, 2024 06:53
Show Gist options
  • Save ZiTAL/9d920a21a7a5c0e4d9d438349a2f0f92 to your computer and use it in GitHub Desktop.
Save ZiTAL/9d920a21a7a5c0e4d9d438349a2f0f92 to your computer and use it in GitHub Desktop.
linux: ldap microsoft samaccountname example
#!/bin/bash
HOST="ldap.zital.eus"
BASEDN="dc=zital,dc=lan"
USER="zital@zital.eus"
PASSWD="12345"
ldapsearch -x -H ldap://${HOST} -b ${BASEDN} -D ${USER} -w ${PASSWD} "(samaccountname=${USER})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment