Sponsored Content
Full Discussion: LDAP data in CSV format
Top Forums Shell Programming and Scripting LDAP data in CSV format Post 302972690 by tfm217 on Monday 9th of May 2016 02:32:14 PM
Old 05-09-2016
If you are up for another challenge... I am also separately trying to pull some more data on "group" objects.

Basically every group is an object "cn=Groupname" and the attributes are "cn" and "uniquemember". The "uniquemember" attribute is repeated as many times as there are users in the group.

Ex:

Code:
 cn=Director,cn=groups,DC=MARCHON,DC=COM
cn=Director
uniquemember=uid=skressman,cn=users,DC=MARCHON,DC=COM
uniquemember=uid=rf1,cn=users,DC=MARCHON,DC=COM
uniquemember=uid=dingino,cn=users,dc=marchon,dc=com
uniquemember=uid=lgittler,cn=users,dc=marchon,dc=com
uniquemember=uid=junger,cn=users,dc=marchon,dc=com

There can be any number of uniquemember's and there is no way to tell when the last one is being read, unless you consider the next thing read in will be a new object (cn=...)

Ideally the output would be cn,cn,uniquemember,uniquemember,uniquemember,...(multiplied by the current # of entries)

Last edited by RudiC; 05-09-2016 at 03:37 PM.. Reason: Changed icode to code tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to format a .CSV data

Hi There I needed to write a Unix shell script which will pick up the data from a .CSV file and reformat it as per the requirement and write it to another .CSV file. Currently I am in the proess of Data Import to "Remedy System" (A one kind of incident mangement Application) and this... (8 Replies)
Discussion started by: Uday1982
8 Replies

2. Shell Programming and Scripting

AWK CSV to TXT format, TXT file not in a correct column format

HI guys, I have created a script to read 1 column in a csv file and then place it in text file. However, when i checked out the text file, it is not in a column format... Example: CSV file contains name,age aa,11 bb,22 cc,33 After using awk to get first column TXT file... (1 Reply)
Discussion started by: mdap
1 Replies

3. UNIX for Advanced & Expert Users

shell script to format .CSV data

Hi all, I have written a shell script to search a specified directory (e.g. /home/user) for a list of specific words (shown as ${TMPDIR}/wordlist below). The script works well enough, but I was wondering if there was a way to display the line number that the word is found on? Thanks! cat... (1 Reply)
Discussion started by: tmcmurtr
1 Replies

4. Shell Programming and Scripting

Retaining the Unix CSV format in Excel format while exporting

Hi All, I have created a Unix Shell script whch creates a *.csv file and export it to Excel. The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example : if the Amount has the value as 3000000 User wants to be in 3,000,000 format. This Amount format... (2 Replies)
Discussion started by: rawat_me01
2 Replies

5. Shell Programming and Scripting

Conversion of xhtml data into csv format using dump utility

Hi Unix Gurus, I tried to convert the attached xhtml table content into csv file using unix shell script (lynx -dump filename) and got the below results: Title ID Owner Priority Estimate Project Change Date Changed By Complexity Create Date Created By Detail Estimate Total De tail... (6 Replies)
Discussion started by: bi.infa
6 Replies

6. Shell Programming and Scripting

CSV data format manipulation

Hi There I need a script which will pick up the data from a .CSV file and reformat it as per the requirement and write it to another .CSV file. I am using an application that will only take data in a particular format and need something that will convert without manual intervention. The... (4 Replies)
Discussion started by: rbggbr16
4 Replies

7. Shell Programming and Scripting

LDAP data in CSV format - Part II

User Aia had created this below script to help translate LDIF files to CSV format, and it works very well (thanks again Aia if you are reading this) Here is the original thread. https://www.unix.com/shell-programming-and-scripting/265753-ldap-data-csv-format.html?referrerid=302170129 However... (2 Replies)
Discussion started by: tfm217
2 Replies

8. Shell Programming and Scripting

Convert csv data to html format

I am new to html and need to convert the attached csv file data to html format ; running into issues. please assist. #!/bin/ksh echo "<html>" ; echo "<head><style> table {border-collapse: collapse;} table, td, th {border: 1px solid black;} </style></head>" echo "<title> REPORT </title>" echo... (0 Replies)
Discussion started by: archana25
0 Replies

9. Shell Programming and Scripting

Can we filter the below log data into CSV format?

HI , I m looking for help here!!! Can we filter the below log data into CSV format ? timestamp INFO <text > - Some text Drive .. Need a format of separate field such as 1 2 3 4 ... (2 Replies)
Discussion started by: MohSalNiz
2 Replies

10. UNIX for Beginners Questions & Answers

Log file data into CSV format

I m looking for help here!!! Can we filter the below log data into CSV format ? 1 2 3 4 5 6 7 8 timestamp INFO <text > - Some text (1 Reply)
Discussion started by: MohSalNiz
1 Replies
Jifty::Plugin::AuthzLDAP(3pm)				User Contributed Perl Documentation			     Jifty::Plugin::AuthzLDAP(3pm)

NAME
Jifty::Plugin::AuthzLDAP - Jifty plugin to a add dynamic ldap authorization DESCRIPTION
Jifty plugin. Provide ldap authorization with filters table and cache. CONFIGURATION NOTES
in etc/config.yml Plugins: - AuthzLDAP: LDAPbind: cn=testldap,ou=admins,dc=myorg,dc=org # LDAPpass: test # password LDAPhost: ldap.myorg.org # ldap host LDAPbase: ou=people,dc=myorg.. # ldap base LDAPuid: uid # optional CacheTimout: 20 # minutes, optional, default 20 minutes in application create a LDAPFilter model use base qw/Jifty::Plugin::AuthzLDAP::Model::LDAPFilter/; in LDAPFilter model create your filters, something like name |filter |is_group is_admin|(!eduPersonAffiliation=STUDENT)|0 in_admin|cn=admin,ou=groups,dc=my.org |1 to protect access to /admin in "TestApp" application create a lib/TestApp/Dispatcher.pm use strict; use warnings; package TestApp::Dispatcher; use Jifty::Dispatcher -base; before '/admin/*' => run { # Authentication Jifty->web->tangent(url => '/login') if (! Jifty->web->current_user->id); # Authorization my $user = Jifty->web->current_user->user_object->name; Jifty->web->tangent(url => '/error/AccessDenied') if (! Jifty::Plugin::AuthzLDAP->ldapvalidate($user,'is_admin') ); }; 1 SEE ALSO
Net::LDAP METHODS
init load config parameters, connect to ldap, create memory cache BASE CACHE DN LDAP BASE UID PASS LDAPFilterClass accesors to conf parametres bind Bind to ldap ldapvalidate NAME FILTERNAME return 1 if NAME validate FILTER or NAME-FILTERNAME in cache else return 0 If FILTERNAME is flagged as is_group, search if user is uniquemember of this group as supported by the Netscape Directory Server AUTHOR
Yves Agostini, <yvesago@cpan.org> LICENSE
Copyright 2007-2009 Yves Agostini. All Rights Reserved. This program is free software and may be modified and distributed under the same terms as Perl itself. perl v5.10.0 2009-05-15 Jifty::Plugin::AuthzLDAP(3pm)
All times are GMT -4. The time now is 11:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy