diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-05-01 09:58:27 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:16:25 -0500 |
commit | 060ea529892f0221438b81219559a195bb2c87b3 (patch) | |
tree | 73e409ddaaeb39c370eacce87e757862fcceb2a8 /source4/script | |
parent | dfaa7a3baeafa401c5ee3490ef11f23870f65cf1 (diff) | |
download | samba-060ea529892f0221438b81219559a195bb2c87b3.tar.gz samba-060ea529892f0221438b81219559a195bb2c87b3.tar.bz2 samba-060ea529892f0221438b81219559a195bb2c87b3.zip |
r6549: a simple ldap test script
(This used to be commit e2f5d36e47cab2e9bc199b743ab6d5a040e6e175)
Diffstat (limited to 'source4/script')
-rwxr-xr-x | source4/script/tests/test_ldap.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/script/tests/test_ldap.sh b/source4/script/tests/test_ldap.sh new file mode 100755 index 0000000000..1aeb74baa8 --- /dev/null +++ b/source4/script/tests/test_ldap.sh @@ -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 + |