[ngw] Importing csv file using LDIF import wizard

Keith Larson klarson at k12group.net
Thu Feb 26 20:47:31 UTC 2015


Here is an example of one that I use, but won't help with this
situation.  The .import file only has a properly formatted dn.  The rest
is appended to that to make an ldif that will set password properties
the way that I need them.  You would just substitute the values that you
want.  Experiment with this and it will help you get the right idea.  If
you are using different values for each user, like your scenario, then
you have to use something like sed to make all of the search/replace
things that you need.
 
#!/bin/sh
 
rm $1.ldif
touch $1.ldif
 
cat $1.import | while read line
do
if [[ "$line" == *dn:* ]]
then
	    echo $line >>$1.ldif
	    echo "changetype: modify" >>$1.ldif
	    echo "replace: passwordRequired" >>$1.ldif
	    echo "passwordRequired: TRUE" >>$1.ldif
 echo "-" >>$1.ldif
	    echo "replace: passwordMinimumLength"  >>$1.ldif
	    echo "passwordMinimumLength:  6" >>$1.ldif
 echo "-" >>$1.ldif
	    echo "replace: passwordUniqueRequired" >>$1.ldif
	    echo "passwordUniqueRequired: FALSE" >>$1.ldif
 echo "-" >>$1.ldif
	    echo "replace: passwordAllowChange" >>$1.ldif
	    echo "passwordAllowChange: TRUE" >>$1.ldif
 echo "-" >>$1.ldif
	    echo "replace: loginGraceLimit" >>$1.ldif
	    echo "loginGraceLimit: 6" >>$1.ldif
 echo "-" >>$1.ldif
	    echo "replace: loginGraceRemaining" >>$1.ldif
	    echo "loginGraceRemaining: 6" >>$1.ldif
 echo "-" >>$1.ldif
	    echo "replace: passwordExpirationInterval" >>$1.ldif
	    echo "passwordExpirationInterval: 31536000" >>$1.ldif
 echo "-" >>$1.ldif
	    echo "replace: passwordExpirationTime" >>$1.ldif
	    echo "passwordExpirationTime: 20141118100050Z" >>$1.ldif
	    echo "" >>$1.ldif
fi
done
 
 
 >>> "Joe Acquisto-j4" <joea at j4computers.com> 2/26/2015 3:08 PM >>>
It's a matter of the format of the input file.

You have to be able to "label" or somehow identify each of the pieces
of
information
you wish to import so they end up in the "right place".

A simple csv file just is not going to suffice.  You need to massage
it
into LDIF format.

Do a Google on LDIF files and you will see what is required.  Maybe
google on LDIF format 
utilities.  I imagine someone has come up with a Windows util that
will
let you select and label
items in a csv with an LDIF label.

joe a.



>>> "Paul Aboukhaled" <PABOUKHALED at metrohealth.org> 02/26/15 2:41 PM
>>>
I am using ConsolOne 1.3.6h build JDK 1.4.2 JVM 1.5.0_11
So I have to find an LDIF import utility?

How about using iManager 2.7.7, any better than ConsolOne?

Thanks

PA

>>> "Joe Acquisto-j4" <joea at j4computers.com> 2/26/2015 10:56 AM >>>
It would be helpful to know what version you are on and what sort of
information
you are trying to import.  

But, that said, The import wizard in Console One for instance, is just
that.  AFAIK, 
an LDIF import file is required, so you will have to construct one.   

joe a.

>>> "Paul Aboukhaled" <PABOUKHALED at metrohealth.org> 02/26/15 10:11 AM
>>>
I am trying to update our organization address book to date. I have
compiled the users information (userID, cell phone, work.....) How I
can
use the ldif wizard to import the csv file?

Thanks

Paul Aboukhaled

MetroHealth’s Mission: Leading the way to a healthier you and a
healthier community through service, teaching, discovery and teamwork.

Conceptual drawing of how the MetroHealth main campus could be
transformed.   

Follow us on		 ,	 ,	 and    
   
This email and all attachments that may have been included are
intended
only for the use of the party to whom/which the email is addressed and
may contain information that is privileged, confidential, or exempt
from
disclosure under applicable law. If you are not the addressee or the
employee or agent of the intended recipient, you are hereby notified
that you are strictly prohibited from printing, storing,
disseminating,
distributing, or copying this communication. If you have received this
notification in error, please contact the Privacy & Information
Security
Officer at (216)778-5776. For a copy of our Notice of Privacy
Practices,
please click here.		  


_______________________________________________
ngw mailing list
ngw at ngwlist.com
http://ngwlist.com/mailman/listinfo/ngw

MetroHealth’s Mission: Leading the way to a healthier you and a
healthier community through service, teaching, discovery and teamwork.

Conceptual drawing of how the MetroHealth main campus could be
transformed.   

Follow us on		 ,	 ,	 and    
   
This email and all attachments that may have been included are
intended
only for the use of the party to whom/which the email is addressed and
may contain information that is privileged, confidential, or exempt
from
disclosure under applicable law. If you are not the addressee or the
employee or agent of the intended recipient, you are hereby notified
that you are strictly prohibited from printing, storing,
disseminating,
distributing, or copying this communication. If you have received this
notification in error, please contact the Privacy & Information
Security
Officer at (216)778-5776. For a copy of our Notice of Privacy
Practices,
please click here.		  


_______________________________________________
ngw mailing list
ngw at ngwlist.com
http://ngwlist.com/mailman/listinfo/ngw


More information about the ngw mailing list