From: Rafael C. <Raf...@li...> - 2002-05-21 16:49:15
|
Hello, I've written an LDAP Shell in perl, based on Net::LDAP. It's somewhat well documented but not packaged. If I extrapolate our needs here at business, I think it's very usefull. With it, you can do things such as (it's a shell): cd ou=3DUsers search 'profilepath=3D*' change {$_->delete('profilepath') if $_->get_value('department') =3D~ /(Old|New) NAME/i} changes commit This will: 0) Change the "working directory" to "OU=3DUsers" 1) Search all the entries with this attribut set 2) Delete the "profilepath" attribute for all entries where the "department" matches /(Old|New) Name/i 3) Show the changes done 4) Commit the changes to the server (Net::LDAP::Entry->update) You can also do "ls", "cd"... You can ask for help with "help", or typing "<CTRL>-t" after a command ("bind <CTRL>-t") (provided you have Term::ReadLine::Gnu installed). And a lot of more cool things. See the HTML documentation (or type perlpod ldapsh) attached. 3 files attached: 1) ldapsh: The shell itself. Runs under Unix/Windows provided you have Net::LDAP (and preferably Term::ReadLine::Gnu) 2) ldapsh.html: The code generated with pod2html 3) A sample of .ldapshrc (rename it from ldapshrc to .ldapshrc, edit it and put it on your home directory). Feel free to send corrections/comments. Rafael |