CSVDE syntax

D

donald

can someone give me a good link for understanding how
this utility works? I understand the basics of LDAP but
cannot get .csv files I create to import users with this
utility. Thanks.
 
H

Herb Martin

I am not an expert on these programs (I sometimes hack my way
through), but if you know LDAP then you might prefer: LDIFDE
instead of the CSV version.
 
C

Cary Shultz [A.D. MVP]

Donald,

In continuation to what Herb stated, here is an example of using ldifde to
create two user accounts:
===============================================================

DN: CN=Cary Shultz,CN=Users,DC=Youdomain,DC=Local
changeType: add
objectClass: user
userAccountControl: 512
sAMAccountName: cshultz
displayName: Cary Shultz
cn: Cary Shultz
givenName: Cary
sn: Shultz
company: NKD Solutions, Inc.
streetAddress: 123 Main Street
l: Roanoke
st: VA
postalCode: 24014
c: US
co: United States
countryCode: 840
department: IT
physicalDeliveryOfficeName: Roanoke
telephoneNumber: 540.555.1212

DN: CN=Erin Xavier,CN=Users,DC=Youdomain,DC=Local
changeType: add
objectClass: user
userAccountControl: 512
sAMAccountName: exavier
displayName: Erin Xavier
cn: Erin Xavier
givenName: Erin
sn: Xavier
company: NKD Solutions, Inc.
streetAddress: 123 Main Street
l: Roanoke
st: VA
postalCode: 24014
c: US
co: United States
countryCode: 840
department: IT
physicalDeliveryOfficeName: Roanoke
telephoneNumber: 540.555.1212

================================================================

All you would do is use NotePad to create this and call it 'users.ldf' - or
whatever made sense to you - and go to a DC and enter at a command prompt
'ldifde -i -f users.ldf' - without the quotes - and away you go. I
personally like to add the -s servername and -t portnumber switches but this
is usually unnecessary. If you choose to do so then the command would look
like this: ldifde -i -f users.ldf -s w2kserver01 -t 389. I would naturally
test this in a test environment first.

If you have user accounts that already exist and you need to
change/add/delete something then the entry would look like this:

===========================================

DN: CN=Cary Shultz,CN=Users,DC=Youdomain,DC=Local
changeType: modify
replace: postalCode
postalCode: 24018
-

DN: CN=Erin Xavier,CN=Users,DC=Youdomain,DC=Local
changeType: modify
replace: postalCode
postalCode: 24018
-

============================================

This would simply change the existing postalCode attribute ( aka Zip Code )
from 24014 to 24018. BTW - the little dash ( - ) at the end of each entry
is very important when modifying things....


ldifde does not easily allow you to create a user account with a password.
You might want to look at addusers.exe - which does allow you to create a
password for each user account - and then come in behind that with either
ldifde or a great tool called ADModify. ADModify allows you to change a
good many attributes to multiple accounts at once. You can find ADModify at
the following MS ftp site:

ftp://ftp.microsoft.com/PSS/Tools/Exchange%20Support%20Tools/ADModify/

This tool will possibly save you a lot of time!!!

HTH,

Cary
 
M

Moreno

Hi to all.

LDIFDE is a good instrument but in the case of DONALD
using CSVDE is more simple than LDIFDE.

Here is the syntax of the command for creating users
starting from a *.CSV file:

CSVDE [-i] [-f Filename] [-k]

where:

[-i] : specifies the IMPORT mode

[-f Filename] : Specifies the file *.CSV to use

[-k] : ignores errors

So, to create a list of users in the Active Directory
starting form a CSV file the steps are:

1) CREATE THE *.CSV FILE
========================

Using NOTEPAD create a file (Example: users.csv) where THE
FIRST LINE MUST BE AS FOLLOWS and the OTHER lines contains
the users informations.

Example:


=====START OF "USERS.CSV FILE"=====
DN,objectClass,sAMAccountName,sn,givenName,userPrincipalNam
e

"CN=John
Smith,OU=Marketing,DC=doman,DC=com",user,jsmith,Smith,John,
(e-mail address removed)

"CN=Lorraine
Baker,OU=Marketing,DC=doman,DC=com",user,lbaker,Baker,Lorra
ine,[email protected]
=====END OF "USERS.CSV FILE"=====

In this example, the CSVDE command will create TWO USERS
(John Smith and Lorraine Baker) in the OU "Marketing" in
the domain "DOMAIN.COM"

Of course, you must change the OU information and the DC
information reflecting you organization.


2) RUN THE COMMAND
==================
Once you have done this, save this file in c:\ and then
type this command followed by [RETURN]

CSVDE -i -f c:\users.csv

If all entries are correct, the result is the creation of
ALL the users, one for each line described in the file.


Hope this helps you.

Bye.

Moreno
(Senior IT Manager - Italy)
 
C

Cary Shultz [A.D. MVP]

Moreno,

Thank you for giving Donald a good example of csvde and it's syntax.

Cary

Moreno said:
Hi to all.

LDIFDE is a good instrument but in the case of DONALD
using CSVDE is more simple than LDIFDE.

Here is the syntax of the command for creating users
starting from a *.CSV file:

CSVDE [-i] [-f Filename] [-k]

where:

[-i] : specifies the IMPORT mode

[-f Filename] : Specifies the file *.CSV to use

[-k] : ignores errors

So, to create a list of users in the Active Directory
starting form a CSV file the steps are:

1) CREATE THE *.CSV FILE
========================

Using NOTEPAD create a file (Example: users.csv) where THE
FIRST LINE MUST BE AS FOLLOWS and the OTHER lines contains
the users informations.

Example:


=====START OF "USERS.CSV FILE"=====
DN,objectClass,sAMAccountName,sn,givenName,userPrincipalNam
e

"CN=John
Smith,OU=Marketing,DC=doman,DC=com",user,jsmith,Smith,John,
(e-mail address removed)

"CN=Lorraine
Baker,OU=Marketing,DC=doman,DC=com",user,lbaker,Baker,Lorra
ine,[email protected]
=====END OF "USERS.CSV FILE"=====

In this example, the CSVDE command will create TWO USERS
(John Smith and Lorraine Baker) in the OU "Marketing" in
the domain "DOMAIN.COM"

Of course, you must change the OU information and the DC
information reflecting you organization.


2) RUN THE COMMAND
==================
Once you have done this, save this file in c:\ and then
type this command followed by [RETURN]

CSVDE -i -f c:\users.csv

If all entries are correct, the result is the creation of
ALL the users, one for each line described in the file.


Hope this helps you.

Bye.

Moreno
(Senior IT Manager - Italy)





-----Original Message-----
Donald,

In continuation to what Herb stated, here is an example of using ldifde to
create two user accounts:
========================================================== =====

DN: CN=Cary Shultz,CN=Users,DC=Youdomain,DC=Local
changeType: add
objectClass: user
userAccountControl: 512
sAMAccountName: cshultz
displayName: Cary Shultz
cn: Cary Shultz
givenName: Cary
sn: Shultz
company: NKD Solutions, Inc.
streetAddress: 123 Main Street
l: Roanoke
st: VA
postalCode: 24014
c: US
co: United States
countryCode: 840
department: IT
physicalDeliveryOfficeName: Roanoke
telephoneNumber: 540.555.1212

DN: CN=Erin Xavier,CN=Users,DC=Youdomain,DC=Local
changeType: add
objectClass: user
userAccountControl: 512
sAMAccountName: exavier
displayName: Erin Xavier
cn: Erin Xavier
givenName: Erin
sn: Xavier
company: NKD Solutions, Inc.
streetAddress: 123 Main Street
l: Roanoke
st: VA
postalCode: 24014
c: US
co: United States
countryCode: 840
department: IT
physicalDeliveryOfficeName: Roanoke
telephoneNumber: 540.555.1212

========================================================== ======

All you would do is use NotePad to create this and call it 'users.ldf' - or
whatever made sense to you - and go to a DC and enter at a command prompt
'ldifde -i -f users.ldf' - without the quotes - and away you go. I
personally like to add the -s servername and -t portnumber switches but this
is usually unnecessary. If you choose to do so then the command would look
like this: ldifde -i -f users.ldf -s w2kserver01 -t 389. I would naturally
test this in a test environment first.

If you have user accounts that already exist and you need to
change/add/delete something then the entry would look like this:

===========================================

DN: CN=Cary Shultz,CN=Users,DC=Youdomain,DC=Local
changeType: modify
replace: postalCode
postalCode: 24018
-

DN: CN=Erin Xavier,CN=Users,DC=Youdomain,DC=Local
changeType: modify
replace: postalCode
postalCode: 24018
-

============================================

This would simply change the existing postalCode attribute ( aka Zip Code )
from 24014 to 24018. BTW - the little dash ( - ) at the end of each entry
is very important when modifying things....


ldifde does not easily allow you to create a user account with a password.
You might want to look at addusers.exe - which does allow you to create a
password for each user account - and then come in behind that with either
ldifde or a great tool called ADModify. ADModify allows you to change a
good many attributes to multiple accounts at once. You can find ADModify at
the following MS ftp site:

ftp://ftp.microsoft.com/PSS/Tools/Exchange%20Support% 20Tools/ADModify/

This tool will possibly save you a lot of time!!!

HTH,

Cary







.
 
D

donald

BLESS YOU!!!!!

Thanks, I have looked high and low for something this
simple to understand. This is a very big help!

Sincerely, Donald
-----Original Message-----
Hi to all.

LDIFDE is a good instrument but in the case of DONALD
using CSVDE is more simple than LDIFDE.

Here is the syntax of the command for creating users
starting from a *.CSV file:

CSVDE [-i] [-f Filename] [-k]

where:

[-i] : specifies the IMPORT mode

[-f Filename] : Specifies the file *.CSV to use

[-k] : ignores errors

So, to create a list of users in the Active Directory
starting form a CSV file the steps are:

1) CREATE THE *.CSV FILE
========================

Using NOTEPAD create a file (Example: users.csv) where THE
FIRST LINE MUST BE AS FOLLOWS and the OTHER lines contains
the users informations.

Example:


=====START OF "USERS.CSV FILE"=====
DN,objectClass,sAMAccountName,sn,givenName,userPrincipalN am
e

"CN=John
Smith,OU=Marketing,DC=doman,DC=com",user,jsmith,Smith,Joh
n,
(e-mail address removed)

"CN=Lorraine
Baker,OU=Marketing,DC=doman,DC=com",user,lbaker,Baker,Lor
ra
ine,[email protected]
=====END OF "USERS.CSV FILE"=====

In this example, the CSVDE command will create TWO USERS
(John Smith and Lorraine Baker) in the OU "Marketing" in
the domain "DOMAIN.COM"

Of course, you must change the OU information and the DC
information reflecting you organization.


2) RUN THE COMMAND
==================
Once you have done this, save this file in c:\ and then
type this command followed by [RETURN]

CSVDE -i -f c:\users.csv

If all entries are correct, the result is the creation of
ALL the users, one for each line described in the file.


Hope this helps you.

Bye.

Moreno
(Senior IT Manager - Italy)





-----Original Message-----
Donald,

In continuation to what Herb stated, here is an example of using ldifde to
create two user accounts:
========================================================
==
=====

DN: CN=Cary Shultz,CN=Users,DC=Youdomain,DC=Local
changeType: add
objectClass: user
userAccountControl: 512
sAMAccountName: cshultz
displayName: Cary Shultz
cn: Cary Shultz
givenName: Cary
sn: Shultz
company: NKD Solutions, Inc.
streetAddress: 123 Main Street
l: Roanoke
st: VA
postalCode: 24014
c: US
co: United States
countryCode: 840
department: IT
physicalDeliveryOfficeName: Roanoke
telephoneNumber: 540.555.1212

DN: CN=Erin Xavier,CN=Users,DC=Youdomain,DC=Local
changeType: add
objectClass: user
userAccountControl: 512
sAMAccountName: exavier
displayName: Erin Xavier
cn: Erin Xavier
givenName: Erin
sn: Xavier
company: NKD Solutions, Inc.
streetAddress: 123 Main Street
l: Roanoke
st: VA
postalCode: 24014
c: US
co: United States
countryCode: 840
department: IT
physicalDeliveryOfficeName: Roanoke
telephoneNumber: 540.555.1212

========================================================
==
======

All you would do is use NotePad to create this and call it 'users.ldf' - or
whatever made sense to you - and go to a DC and enter
at
a command prompt
'ldifde -i -f users.ldf' - without the quotes - and
away
you go. I
personally like to add the -s servername and -t portnumber switches but this
is usually unnecessary. If you choose to do so then
the
command would look
like this: ldifde -i -f users.ldf -s w2kserver01 -t
389.
I would naturally
test this in a test environment first.

If you have user accounts that already exist and you
need
to
change/add/delete something then the entry would look like this:

===========================================

DN: CN=Cary Shultz,CN=Users,DC=Youdomain,DC=Local
changeType: modify
replace: postalCode
postalCode: 24018
-

DN: CN=Erin Xavier,CN=Users,DC=Youdomain,DC=Local
changeType: modify
replace: postalCode
postalCode: 24018
-

============================================

This would simply change the existing postalCode attribute ( aka Zip Code )
from 24014 to 24018. BTW - the little dash ( - ) at
the
end of each entry
is very important when modifying things....


ldifde does not easily allow you to create a user
account
with a password.
You might want to look at addusers.exe - which does
allow
you to create a
password for each user account - and then come in
behind
that with either
ldifde or a great tool called ADModify. ADModify
allows
you to change a
good many attributes to multiple accounts at once. You can find ADModify at
the following MS ftp site:

ftp://ftp.microsoft.com/PSS/Tools/Exchange%20Support% 20Tools/ADModify/

This tool will possibly save you a lot of time!!!

HTH,

Cary
hack
my way prefer:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top