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:
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
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