Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- read -sp "Password: " passw < /dev/tty
- host=$1
- user=$2
- base=$3
- query=$4
- function adsearch {
- query=$1
- ldapsearch -x -LLL -D "$user" -b "$base" -w "$passw" -h "$host"($query)" samaccountname
- }
- function getusername {
- perl -nle '/sAMAccountName: (.*)/ && print $1'
- }
- adsearch "$passw" "$query"
Add Comment
Please, Sign In to add comment