Solved

What is the correct syntax to use for CSVDE to get the desired output

Posted on 2010-11-22
13
964 Views
Last Modified: 2012-05-10
How can I export data from large A D tree into a csv file. The OU that I need exported is PHD\Users and Groups\EMEA\United Kingdom\London The Domain is Called Global.com I need logonname, homedrive and home drive path. I know that I can get the data by using the csvde command and output to a csv file
0
Comment
Question by:EMEA iOps
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
13 Comments
 
LVL 71

Expert Comment

by:Chris Dent
ID: 34187552

Hello there,
csvde -r "(&(objectClass=users)(objectCategory=person))" -d "OU=London,OU=United Kingdom,OU=EMEA,OU=Users and Groups,OU=PHD,DC=global,DC=com" -l "sAMAccountName,homeDrive,homeDirectory" -f YourFile.csv

Open in new window

HTH

Chris
0
 

Author Comment

by:EMEA iOps
ID: 34187799
Hi Chris, I eneterd your suggested string, however it is not producing the desired output as I get after typing the command: Connecting to "(null)" login in as current user (I've got admin rights) using SSPI exporting directory to myfile.csv Searching for entries... Writing out entries No entries found The command has completed successfully. There are lots of objects in the container
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 71

Assisted Solution

by:Chris Dent
Chris Dent earned 75 total points
ID: 34187821

It's likely this path is not correct:

"OU=London,OU=United Kingdom,OU=EMEA,OU=Users and Groups,OU=PHD,DC=global,DC=com"

CSVDE doesn't validate it, if the path is not correct it will simply say it found nothing.

With that in mind, the path above translates to:

global.com/PHD/Users and Groups/EMEA/United Kingdom/London

Is that correct?

If unsure, pop open ADSIEdit, browse to the folder you want, open Properties and look at the DistinguishedName property, that's the value we must use.

Chris
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 34187840

Incidentally, if you have a lot of tasks like this to do, PowerShell with Quests AD CmdLets would simplify the interface for you (it will tell you if the path is wrong with "A referral was returned from the server").

Chris
0
 

Author Comment

by:EMEA iOps
ID: 34187871
Hi Chris,
Thanks for your answer the path is right the Canonical name of object is:
global.com/PHD/Users and Groups/EMEA/United Kingdom/London
Any ideas?
0
 
LVL 71

Assisted Solution

by:Chris Dent
Chris Dent earned 75 total points
ID: 34187936

Hmm well that's helpful of it. That should work.

-r is the filter and tells it you want user accounts (drops contacts and computers, caught by either condition on its own).
-d is the Search Root, and should work with what we have above
-l is the list of attributes (but we're not getting that far)

Lets drop the filter for now, and lets move up a level in the structure:
csvde -d "OU=United Kingdom,OU=EMEA,OU=Users and Groups,OU=PHD,DC=global,DC=com" -l "sAMAccountName,homeDrive,homeDirectory" -f YourFile.csv

Open in new window

Chris
0
 

Accepted Solution

by:
EMEA iOps earned 0 total points
ID: 34188052
Excellent the above syntax produced the desired output. Thanks for your help
0
 

Author Comment

by:EMEA iOps
ID: 34206891
I do also need to get their primary SMTP email address. What would be the sintax for it?
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 34206921

You just need the mail field, that holds the primary address.
csvde -d "OU=United Kingdom,OU=EMEA,OU=Users and Groups,OU=PHD,DC=global,DC=com" -l "sAMAccountName,homeDrive,homeDirectory,mail" -f YourFile.csv

Open in new window

Chris
0
 

Author Comment

by:EMEA iOps
ID: 34206947
Chris, you're a star mate.
0
 

Author Closing Comment

by:EMEA iOps
ID: 34221174
Thanks for your comments
0
 

Author Comment

by:EMEA iOps
ID: 34293418
Hi I have got a file exported, now I need to import the data once the home directory path has been updated. Can anyone help with the syntax: csvde -i -f filename.csv
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question