-
Notifications
You must be signed in to change notification settings - Fork 16
/
ldapsearch_examples.sh
executable file
·94 lines (78 loc) · 2.73 KB
/
ldapsearch_examples.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
. env.sh
. demo-magic.sh -d -p -w ${DEMO_WAIT}
export IP_ADDRESS=$(ipconfig getifaddr en0)
cat << EOF
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} \\
-b dc=ourcorp,dc=com \\
-D "cn=read-only,dc=ourcorp,dc=com" \\
-w ${LDAP_READONLY_USER_PASSWORD}
EOF
p
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} -b dc=ourcorp,dc=com -D "cn=read-only,dc=ourcorp,dc=com" -w ${LDAP_READONLY_USER_PASSWORD}
p
cat << EOF
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} \\
-b ou=posix_group,dc=ourcorp,dc=com \\
-D "cn=read-only,dc=ourcorp,dc=com" \\
-w ${LDAP_READONLY_USER_PASSWORD}
EOF
p
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} -b ou=posix_group,dc=ourcorp,dc=com -D "cn=read-only,dc=ourcorp,dc=com" -w ${LDAP_READONLY_USER_PASSWORD}
p
cat << EOF
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} \\
-b ou=posix_group,dc=ourcorp,dc=com \\
-D "cn=read-only,dc=ourcorp,dc=com" \\
-w ${LDAP_READONLY_USER_PASSWORD} \\
'(cn=admins)'
EOF
echo
p
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} -b ou=posix_group,dc=ourcorp,dc=com -D "cn=read-only,dc=ourcorp,dc=com" -w ${LDAP_READONLY_USER_PASSWORD} '(cn=admins)'
p
cat << EOF
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} \\
-b ou=posix_group,dc=ourcorp,dc=com \\
-D "cn=read-only,dc=ourcorp,dc=com" \\
-w ${LDAP_READONLY_USER_PASSWORD} \\
'(cn=admins)' \\
memberUid
EOF
echo
p
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} -b ou=posix_group,dc=ourcorp,dc=com -D "cn=read-only,dc=ourcorp,dc=com" -w ${LDAP_READONLY_USER_PASSWORD} '(cn=admins)' memberUid
p
cat << EOF
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} \\
-b ou=posix_group,dc=ourcorp,dc=com \\
-D "cn=read-only,dc=ourcorp,dc=com" \\
-w ${LDAP_READONLY_USER_PASSWORD} \\
'(cn=admins)' \\
memberUid +
EOF
echo
p
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} -b ou=posix_group,dc=ourcorp,dc=com -D "cn=read-only,dc=ourcorp,dc=com" -w ${LDAP_READONLY_USER_PASSWORD} '(cn=admins)' memberUid +
p
cat << EOF
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} \\
-b ou=people,dc=ourcorp,dc=com \\
-D "cn=read-only,dc=ourcorp,dc=com" \\
-w ${LDAP_READONLY_USER_PASSWORD} \\
'(memberOf=cn=rockstars,ou=um_group,dc=ourcorp,dc=com)' +
EOF
echo
p
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} -b ou=people,dc=ourcorp,dc=com -D "cn=read-only,dc=ourcorp,dc=com" -w ${LDAP_READONLY_USER_PASSWORD} '(memberOf=cn=rockstars,ou=um_group,dc=ourcorp,dc=com)' +
p
cat << EOF
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} \\
-b ou=people,dc=ourcorp,dc=com \\
-D "cn=read-only,dc=ourcorp,dc=com" \\
-w ${LDAP_READONLY_USER_PASSWORD} \\
'(memberOf=cn=founders,ou=um_group,dc=ourcorp,dc=com)' \\
dn
EOF
echo
p
ldapsearch -LLL -x -H ldap://${IP_ADDRESS} -b dc=ourcorp,dc=com -D "cn=read-only,dc=ourcorp,dc=com" -w ${LDAP_READONLY_USER_PASSWORD} '(memberOf=cn=founders,ou=um_group,dc=ourcorp,dc=com)' dn