|
| ||||||||||
| Tags: csvde |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| csvde export, excluding specific OU's.
"(&(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. |
|
#2
| ||||
| ||||
|
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. |
|
#3
| |||
| |||
|
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... |
|
#4
| ||||
| ||||
| 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 /?? |
|
#5
| |||
| |||
|
If I queried each OU individually, how would I get it to append to the same file? |
|
#6
| ||||
| ||||
| 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. |
|
#7
| |||
| |||
|
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. |
|
#8
| ||||
| ||||
| 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. |
|
#9
| |||
| |||
|
To export users and contacts, would I just use: "(objectCategory=person)" ?? |
|
#10
| ||||
| ||||
| 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. |
|
#11
| |||
| |||
|
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... |
![]() |
|
| Thread Tools | Search this Thread |
| |
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 |