View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Simon Adlem > OSS-LDAPops-1.033 >


Annotate this POD


Open  0
View/Report Bugs

NAME ^ - perform operations on an LDAP directory from the command line


Perform operations on the OSS ldap directory

This code uses the module for OSS directory actions, "OSS::LDAPops." Please see OSS::LDAPops for more details.

This program will return nothing on sucess and will die with an error message to STDERR on fail.

All operations required to administer the directory are avaliable via this program apart from changing objects outside of the user and group space. These must be altered manuaelly.

This code does not have to run on the LDAP server as it is network enabled and can be used over the network from a suitable location, ACL permitting of course!


A configuration file is required in /etc/ldapops.conf or ~/.ldapopsrc. An example is below:

        $GLOBAL::config =
                LDAPHOST        =>      '',
                BINDDN          =>      'uid=webportal, ou=writeaccess, dc=auth, dc=mydomain,dc=net',
                BASEDN          =>      'dc=auth,dc=mydomain,dc=net',
                NISDOMAIN       =>      '',
                PASSWORD        =>      'xyzzy',

        #These config options are used within this script
        $GLOBAL::localconfig =
                SHADOWMAX       =>      90,
                SHADOWMIN       =>      10,
                SHADOWWARNING   =>      10,
                SHELL           =>      '/bin/bash',
                #Trailing '/' please!
                HOMEPREFIX      =>      '/home/',
                GID             =>      300

        #This 1 is required!

This example file is also included in the source distribution.

USAGE ^ -su <string>                       | search user -sg <string>                       | search netgroup -sx <string>                       | search unix/posix group -ah <hostname>                     | add host -ahg <group>                       | add hostgroup -aug <user>                        | add usergroup -axg <group> <gid>                 |add unix/posix group -auug <userid> <group>             | add user to user group -duug <userid> <group>             | delete user from user group
        ldapops.l -auh <userid> <host>               | add user to host -duh <userid> <host>               | delete user from host -ahhg <host> <group>               | add host to host group -dhhg <host> <group>               | delete host from host group -augug <addgroup> <togroup>        | add user group to user group -dugug <delgroup> <fromgroup>      | delete user group from user group -ahghg <addgroup> <togroup>        | add host group to host group -dhghg <delgroup> <fromgroup>      | delete host group from host group -aung <userid> <unix group>        | add user to unix group -dung <userid> <unix group>        | del user from unix group -au                                | add user -up <userid> <password>            | update password for user -upr <userid> <password>           | update password for user and force reset on next login -upo <userid> <password> <ou>      | update password for user in non-standard ou -b <csv file>                      | batch add users from CSV file (see batchadd.csv for format) -d '<dn>'                          | delete dn (note the quotes)

Note: the wildcard '*' can be used, but must be escaped as \*

syntax highlighting: