1.

Solve : CSVDE help?

Answer»

Okay here's the situation: I need to use CSVDE to query AD and return me a LIST of e-mail addresses. I don't need this for every username in our domain just certain ones. I have a list of usernames in one file and wrote a little 'for' batch file to run the command agaisnt there NAMES

Code: [Select]for /f "delims=" %%a in (h:\test.txt) do csvde -f h:\test.csv -s SERVERNAME -d "dc=DOMAIN,dc=org" -r "(&(objectClass=user)(sAMAccountName=%%a))" -l mail

This acutally works fine, the problem is that csvde overwrites the file, not appends to it, so basically i end up with one email address when it's all said and done. I've searched online and can't find a way to make it append. Was hoping SOMEBODY could help me out. THANKS!

Alternatevely, if somebody knows a better METHOD to accomplish this I'm open to suggestion

Google turned up this solution which uses the pipe symbol. You would eliminate the test.txt file and string the account names on the command line. Might be useful if test.txt contains only a few names.

Another solution would be to create unique output file names and use the copy command to concatenate them into a single file after the for command completes.

Good luck.



Discussion

No Comment Found