Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Active Directory
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



csvde export, excluding specific OU's.

Active Directory


Reply
 
Thread Tools Search this Thread
  #1  
Old 27-05-2006
Member
 
Join Date: Dec 2005
Posts: 136
csvde export, excluding specific OU's.

I am working with a csvde to export all user accounts but I want to exclude some OUs. There is a problem with it and wanted to pass it out here for anyone that can correct me. I am working with -r (filter) and I am right now working it as:

"(&(objectCategory=user)(!cn=*,ou=serviceaccounts,dc=company,dc=com))"
or
"(&(objectCategory=user)(!ou=serviceaccounts,dc=company,dc=com))" and other variants.

The exclamation is to exclude or not from what I have read and seen in the examples as used for attributes of accounts to filter on. I am trying to get over and try joeware but wanted to check on the csvde syntax since I have a feeling that I am going to be asked for other things such as multiple OUs to exclude to certain attributes and then use them for import.

Reply With Quote
  #2  
Old 30-05-2006
Member
 
Join Date: Nov 2005
Posts: 631
Have you tried using the tool called ADManager Plus to export all the users except some of the OUs. Check out its demo from its official website by searching on the net.
Reply With Quote
  #3  
Old 19-02-2007
Member
 
Join Date: Feb 2007
Posts: 5
I am also trying to do the same thing, exclude certain OU's or only use the OU's that I have specified. This is what I have:

CSVDE -d "OU=Users,OU=Information Technology,OU=Departments,DC=domain,DC=domain,dc=com" -f Export.csv -r objectCategory=person -l "cn, l, st, title, department, company, userPrincipalName"

That only does 1 OU...
Reply With Quote
  #4  
Old 20-02-2007
Member
 
Join Date: Nov 2005
Posts: 1,173
Re: csvde export, excluding specific OU's.

I guess that with pure LDAP, the only option left for you is to query each level individually, there cannot be another way to filter out specific subou's. Adfind has a filtering built into it via the -excldn switch, so you can download the same and check at adfind /??
Reply With Quote
  #5  
Old 20-02-2007
Member
 
Join Date: Feb 2007
Posts: 5
If I queried each OU individually, how would I get it to append to the same file?
Reply With Quote
  #6  
Old 21-02-2007
Member
 
Join Date: Sep 2005
Posts: 1,364
Re: csvde export, excluding specific OU's.

I dont think you can do that with csvde, you will need to create separate files and then join them.
Reply With Quote
  #7  
Old 21-02-2007
Member
 
Join Date: Feb 2007
Posts: 5
I know...I have created the scripts to make the seperate files, I just need to know how to join the files through some type of script...and not an external program. I know there are programs out there that will join them, but I'm trying to make this all into one script. Right now I'm using vbs.
Reply With Quote
  #8  
Old 22-02-2007
Member
 
Join Date: Oct 2005
Posts: 449
Re: csvde export, excluding specific OU's.

You need to open an output file and after that get list of files to read. After that open file from to read list and read file. Now you can try to strip header line and if the first one right it to file, else validate that it is the same as first header file, that is nothing changed, and then write in file to out file and loop. You need to make sure that the attributes returned are the same as the headers can vary based on what is returned.
Reply With Quote
  #9  
Old 22-08-2007
Member
 
Join Date: Feb 2007
Posts: 5
To export users and contacts, would I just use:

"(objectCategory=person)"

??
Reply With Quote
  #10  
Old 23-08-2007
Member
 
Join Date: Sep 2005
Posts: 193
Re: csvde export, excluding specific OU's.

If you are using the filter with -r then it will work and give you users and contacts, but also computer accounts. You can use "(&(objectCategory=person)(!objectCategory=computer))" which will filter the results down to only users and contacts.
Reply With Quote
  #11  
Old 27-08-2007
Member
 
Join Date: Feb 2007
Posts: 5
Ok thanks. I have one more question...how would I get the fields to be exported in a certain order by columns in the csv file? I am having a horrible time trying to figure it out, it seems like its random in the way that it puts it in the csv. It is definitely not in the order that you list the fields...
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Active Directory
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "csvde export, excluding specific OU's."
Thread Thread Starter Forum Replies Last Post
What is the formula for Excel to add days excluding holidays Krupanath MS Office Support 2 24-01-2012 01:08 PM
CSVDE code to export without DN attribute LucasYew Windows Software 4 24-04-2009 09:29 AM
Gaming Rig for 800$ excluding monitor adikumar2010 Motherboard Processor & RAM 2 22-04-2009 12:09 AM
Exporting member of a particular group using csvde Graham Active Directory 8 27-03-2008 06:01 PM
Export Group membership using script\CSVDE PK Windows Server Help 3 08-10-2007 07:46 PM


All times are GMT +5.5. The time now is 05:29 PM.