mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
r6549: a simple ldap test script
(This used to be commit e2f5d36e47cab2e9bc199b743ab6d5a040e6e175)
This commit is contained in:
parent
dfaa7a3bae
commit
060ea52989
20
source4/script/tests/test_ldap.sh
Executable file
20
source4/script/tests/test_ldap.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
SERVER="$1"
|
||||
|
||||
# test some simple LDAP operations
|
||||
|
||||
echo "Testing RootDSE"
|
||||
ldbsearch -b '' -H ldap://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || exit 1
|
||||
|
||||
echo "Getting defaultNamingContext"
|
||||
BASEDN=`ldbsearch -b '' -H ldap://$SERVER -s base DUMMY=x defaultNamingContext | grep ^defaultNamingContext | awk '{print $2}'`
|
||||
echo "BASEDN is $BASEDN"
|
||||
|
||||
|
||||
echo "Listing Users"
|
||||
ldbsearch -H ldap://$SERVER -b "$BASEDN" '(objectclass=user)' sAMAccountName
|
||||
|
||||
echo "Listing Groups"
|
||||
ldbsearch -H ldap://$SERVER -b "$BASEDN" '(objectclass=group)' sAMAccountName
|
||||
|
Loading…
x
Reference in New Issue
Block a user