Dsbedit, Dsgrpcrt and Adgrpcrt

Three php scripts which can be used to make LDAP changes from csv files.

These scripts were originally written for an eDirectory implementation, and some features will only be useful on that platform, whilst the AD version of Group Creation has a number of features that will only work with Microsoft Active Directory.


The "home directory" feature will only be useful on Novell/eDirectory. Otherwise this script should be useful on any LDAP platform. We use it principally in conjunction with data moves from server to server, and so the home directory functionality is important. It also provides a simple and easy to use means of manipulating LDAP directories without the complexities of more powerful and sophisticated tools.

To use it a csv file containing two columns, one the cn attribute and the other A N other LDAP attribute is placed on the web server, and the application matches unique CNs and modifies the other attribute with the provided value. Duplicated CNs are skipped.


This script will probably only be useful on Novell/eDirectory. Its designed to help with large organisation changes. A csv file contains a list of groups and usernames against each group. On running it the groups are created unless they already exist, and users are made members of the groups. Both the groupMembership and securityEquals attributes are populated for each user, and the member and equivalentToMe attributes are populated for each group. The script handles all the four attributes that must be changed to make eDirectory group membership fully functional.


This script is essentially a port to an Active Directory environment of dsgrpcrt above. It is intended to work with MS AD groups and memberships, and will probably only be of use with AD. The sAMAccountName attribute (pre Windows 2000 name) is used to match objects, and the CN of the object can be set separately from the source text file. In accordance with AD practice the group membership is set only on the group object using the member attribute.

Change History

  1. 17 November 2008 - Initial public release.
  2. 12 February 2009 - Added code for php5 etc systems that don't support the deprecated http_post_vars predefined variable.
  3. 21 May 2009 - Performance Enhancement
  4. 24 January 2010 - corrected minor html error in dsbedit.php
  5. 11 February 2010 - converted dsbedit to use a single script file. Added new script dsgrpcrt.php
  6. 26 February 2010 - Added new script adgrpcrt.php which handles MS AD groups.


Download zip archive

These snippets and utilities are licensed under the University of Illinois/NCSA Open Source License. Here is the text of the license as it applies to this code.

To contact the writer please use this form, or if you prefer use Linked In or even Facebook.

HTML check . CSS check

© Jim Champ, last edit