summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-05-01 09:58:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:25 -0500
commit060ea529892f0221438b81219559a195bb2c87b3 (patch)
tree73e409ddaaeb39c370eacce87e757862fcceb2a8
parentdfaa7a3baeafa401c5ee3490ef11f23870f65cf1 (diff)
downloadsamba-060ea529892f0221438b81219559a195bb2c87b3.tar.gz
samba-060ea529892f0221438b81219559a195bb2c87b3.tar.bz2
samba-060ea529892f0221438b81219559a195bb2c87b3.zip
r6549: a simple ldap test script
(This used to be commit e2f5d36e47cab2e9bc199b743ab6d5a040e6e175)
-rwxr-xr-xsource4/script/tests/test_ldap.sh20
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
+