summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-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
+