Getting list of users

R

Ryan Govostes

Hi,

I'm an Active Directory novice, but I recently needed a way to collect
a list of all of the users in a class in High School in order to merge
them with a forum database. Specifically, I needed each user's login
name (e.g., ajohnso1) and full name (e.g., Adam Johnson).

After doing some research into Active Directory, I found that the csvde
program would probably do what I wanted. After playing around with it a
little while, I decided that the following command should export a CSV
file:

csvde -m -f output.csv -r "objectCategory=Person" -l "name,displayName"
-o "DN" -d "OU=2007 Class,OU=HS,OU=Students,OU=School
Users,DC=school,DC=k12,DC=ny,DC=us"

When I executed that, I got the following message:
Connecting to "school-dc1.school.k12.ny.us"
Logging in as current user using SSPI
Exporting directory to file output.csv
Searching for entries...
Writing out
entries.............................................................
................................................................................ .........................................................................
Export

Completed. Post-processing in progress...
213 entries exported

The command has completed successfully

Which makes me believe that I have a CSV file containing all 213 users
from the Class of 2007. However, when I view it in Excel, I simply get
three column headers: DN, displayName, name. There are no rows printed
thereafter.

Ok, so I'll tweak my command a little to pump out more information, and
I'll just use Excel to cut out the crap I don't need:

csvde -m -f output.csv -r "objectCategory=Person" -d "OU=2007
Class,OU=HS,OU=Students,OU=School Users,DC=school,DC=k12,DC=ny,DC=us"

I get the same message, and this time my file has more than just one
line - but still only about 1/10th of the full list. It just stops
short in the middle of a row and exits.

So, my questions are:
A) Why does filtering everything but the "name" and "displayName"
columns remove all the rows, even though those columns do exist and
have contents?

B) Why does it only print a few rows before exiting, even though it
tells me that there are hundreds of entries?

C) Is there a way to traverse many OUs at once? There are several
classes under "HS", and I'd like to be able to dump them all at once.

Your insight on the problem at hand is appreciated.

Regards,
Ryan Govostes
 
R

Ryan Govostes

Hi,

Thanks for your response. I notice that in the first KB article, it
says that the problem is fixed in version 5.0.2195.3602 and newer. The
server reports a version of 5.0.2195.6601, so it would seem that
something else is at fault.

Is there another thing that might be at fault, or another tool I could
use that might not have the same restriction?

Regards,
Ryan Govostes
 
R

Ryan Govostes

Well, I've figured out that using ldifde works much nicer (it prints
out all of the rows as I wanted), but it's got lots of extra rows (3
that I don't want per user), and Excel can't read it as nicely. I
suppose I could whip up a Perl script to reformat it, though, so it's
all good.

Cheers,
Ryan Govostes
 
K

Ken B

If you have the classes separated into OU's, you could just right click the
OU, and Export List... spits out a CSV file to edit in Excel.

Ken
 

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