Tech Rocks

Coldfusion
Java
JQuery

An online resource for latest web technologies like Coldfusion, JRun, Pro*C, JQuery, HTML5, PHP, W3C, Java, J2EE, C, C++, ORACLE, PL/SQL, MySql, Ajax, Coldbox, Fusebox, UNIX, JavaScript, NodeJS and much more...

Tuesday, December 27, 2011

OpenLDAP testing on Cygwin

jeetu@FVC-Jeetu /usr/local/libexec
$ ./slapd.exe
jeetu@FVC-Jeetu /usr/local/libexec
$ ldapsearch -x -b '' -s base '(objectclass=*)' namingContexts
# extended LDIF
#
# LDAPv3
# base <> with scope baseObject
# filter: (objectclass=*)
# requesting: namingContexts
#
#
dn:
namingContexts: dc=jeetualex,dc=info
# search result
search: 2
result: 0 Success
# numResponses: 2
# numEntries: 1
jeetu@FVC-Jeetu /usr/local/libexec
$ cat > jeetu.ldiff

jeetu@FVC-Jeetu /usr/local/libexec
$ cat > jeetu.ldif
dn: dc=jeetualex,dc=info
objectclass: dcObject
objectclass: organization
o: fvc
dc: jeetualex
dn: cn=Manager,dc=jeetualex,dc=info
objectclass: organizationalRole
cn: Manager
[1]+  Stopped                 cat > jeetu.ldif
jeetu@FVC-Jeetu /usr/local/libexec
$ ls -l
total 1601
-rw-r--r-- 1 jeetu Domain Users     174 Dec 27 20:27 jeetu.ldif
-rw-r--r-- 1 jeetu Domain Users       0 Dec 27 20:27 jeetu.ldiff
-rwxr-xr-x 1 jeetu Domain Users 1578510 Dec 27 18:16 slapd.exe
jeetu@FVC-Jeetu /usr/local/libexec
$ rm jeetu.ldiff
jeetu@FVC-Jeetu /usr/local/libexec
$ ls -l
total 1601
-rw-r--r-- 1 jeetu Domain Users     174 Dec 27 20:27 jeetu.ldif
-rwxr-xr-x 1 jeetu Domain Users 1578510 Dec 27 18:16 slapd.exe
jeetu@FVC-Jeetu /usr/local/libexec
$ vi jeetu.ldif
jeetu@FVC-Jeetu /usr/local/libexec
$ ldapadd -x -D "cn=Manager,dc=jeetualex,dc=info" -W -f jeetu.ldif
Enter LDAP Password:
adding new entry "dc=jeetualex,dc=info"
adding new entry "cn=Manager,dc=jeetualex,dc=info"

jeetu@FVC-Jeetu /usr/local/libexec
$ ldapsearch -x -b 'dc=example,dc=com' '(objectclass=*)'
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# search result
search: 2
result: 32 No such object
# numResponses: 1
jeetu@FVC-Jeetu /usr/local/libexec
$ ldapsearch -x -b 'dc=jeetualex,dc=info' '(objectclass=*)'
# extended LDIF
#
# LDAPv3
# base <dc=jeetualex,dc=info> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#
# jeetualex.info
dn: dc=jeetualex,dc=info
objectClass: dcObject
objectClass: organization
o: fvc
dc: jeetualex
# Manager, jeetualex.info
dn: cn=Manager,dc=jeetualex,dc=info
objectClass: organizationalRole
cn: Manager
# search result
search: 2
result: 0 Success
# numResponses: 3
# numEntries: 2
jeetu@FVC-Jeetu /usr/local/libexec
$

0 comments :

Post a Comment