joeware - never stop exploring... :)

Information about joeware mixed with wild and crazy opinions...

Sending AdFind (and Other Command Line Tool) Output to a File

by @ 11:39 pm on 1/10/2012. Filed under tech

I have been seeing a disturbing trend in email requests for help lately, well I should say the continuation of a disturbing trend I have been seeing in general the last few years. In particular, in the last couple of weeks I have seen no less than 6 or 7 questions of "How do I send the AdFind -csv output to a CSV file?". Perhaps I shouldn’t be disturbed but when I get clusters in a single type of question it tends to stick out and it bothers me that people don’t have enough of an understanding of the command prompt that they don’t know how to perform redirection or perhaps know how to do it but don’t think of it as a solution. At the very least this post gives me a link to point people to instead of answering each email individually. Anyway a few quick words on the subject.

Q: How do I send output from AdFind (and other command line tools) to a file?

A: Via the operating system standard console redirection (aka command line redirection or file redirection) capability. See http://technet.microsoft.com/en-us/library/bb490982.aspx

Really quickly you could do something like

adfind -default -f "&(objectcategory=person)(objectclass=user)(department=human resources)" name displayname samaccountname -csv > hr_dept.csv

   joe

Rating 4.50 out of 5

Comments are closed.

[joeware – never stop exploring… :) is proudly powered by WordPress.]