Using LDAP to list users with limited concurrent connections

  • 7023114
  • 19-Jun-2018
  • 19-Jun-2018

Environment

eDirectory 8.8 SP8

Situation

Using LDAP to list users with limited concurrent connections.

Using LDAP to change the number of concurrent connections available to users.

Resolution

The following syntax was used with ICE.NLM to create a list of users in the tree that have only one concurrent login connection.

ice -S LDAP -s 10.12.13.14 -p 389 -d cn=admin,o=novell -w password -F "(&(objectClass=user)(loginMaximumSimultaneous=1))" -a dn,loginMaximumSimultaneous -b o=novell -c sub -D LDIF -f vol1:\test.ldif -v

-S LDAP specifies the source handler.
-s 10.12.13.14 is the IP address of the LDAP server.
-p 389 is the secure port.
-d cn=admin,o=novell is the user that will log in and -w password is the password for that user. Note the use of the separating comma as opposed to a dot.
-F "(&(objectClass=user)(loginMaximumSimultaneous=1))" is the search filter to find all occurrences of the object class user with Concurrent Logins limited to one.
-a dn,loginMaximumSimultaneous specifies which LDAP fields will be populated in the output file.
-b o=novell specifies the top of the search context. -c sub specifies to search the subtree under that context. In this case the search would include the entire tree under the Organization Container object.
-D specifies the LDIF destination handler.
-f vol1:\test.ldif -v points to the desired location of the output file.

The resulting output file looks something like this:

#This LDIF file was generated by Novell's ICE and the LDIF destination handler.
version: 1

dn: cn=Bulkload1,ou=Pampanga,o=novell
changetype: add
loginMaximumSimultaneous: 1

dn: cn=Bulkload1,ou=Zambales,o=novell
changetype: add
loginMaximumSimultaneous: 1

The output of the above command could then be modified to match the following file and imported in ConsoleOne's LDAP Import Tool. A script could be created to modify the output file of the above command to match the format of the file below, or the same results could be achieved using a Word Processor global find and replace function that supports carriage returns in the replace field.

version: 1

dn: cn=Bulkload1, ou=Pampanga, o=Novell
changetype: modify
replace: loginMaximumSimultaneous
loginMaximumSimultaneous: 2

dn: cn=Bulkload1, ou=Zambales, o=Novell
changetype: modify
replace: loginMaximumSimultaneous
loginMaximumSimultaneous: 2