The new version of ADFind.exe freeware allows you to create and recall environment variables for switch setting:

<b>-e xxx</b>        Load switches from environment. Will read env vars with prefix
              and dash (adfind-) by default and load them in. Any switches
              specified explicitly on the command line will override. To
              specify a different prefix, specify string after -e. For
              example to specify the host switch create an env var of
              adfind-h. To specify properties specify the env var adfind-
              or adfind-props. To specify a switch that doesn't take a
              a value, specify a value of \{~\} because you can't set a
              an environment variable to blank.
                 Ex: Queries ADAM on localhost port 5000 for subnets.
                    set adam1-h=.:5000
                    set adam1-config=\{~\}
                    set adam1-f=objectcategory=subnet
                    set adam1-props=name siteobject
                    adfind -e adam1

Sample:

set csv-default=\{~\}
set csv-bit=\{~\}
set csv-nodn=\{~\}
set csv-tdc=\{~\}
set csv-tdcs=\{~\}
set csv-samdc=\{~\}
set csv-csv=\{~\}
set csv-csvdelim=;
set csv-csvmvdelim=#
adfind -e csv -nocsvheader <font size="1">-f "&(objectcategory=Person)(objectClass=User)" sAMAccountName distinguishedName userPrincipalName MemberOf userAccountControl lastLogon</font>
The output might look like:
<font size="1">"Test";"CN=Test.User,CN=Users,DC=JSIINC,DC=COM";"Test@JSIINC.COM";"CN=Accounts Payables,CN=Users,DC=JSIINC,DC=COM#CN=accountants,CN=Users,DC=JSIINC,DC=COM";"66048 \[NORMAL_USER(512);NO_EXPIRE(65536)\]";"2005/11/15-23:55:00 Eastern Standard Time"</font>
NOTE: See the following tips:
<a href="/article/jsifaq/jsi-tip-9911-how-can-i-save-and-recall-the-switches-i-use-with-adfind-exe-freeware-.aspx">How can I save and recall the switches I use with <b>ADFind.exe</b> freeware?</a>

<a href="/article/jsifaq/jsi-tip-9913-adfind-exe-freeware-can-use-and-and-or-instead-of-1-2-840-113556-1-4-803-and-1-2-840-113556-1-4-804-to-define-a-bitwise-filter-.aspx"><b>ADFind.exe</b> freeware can use <b>:AND:</b> and <b>:OR:</b> instead of <b>:1.2.840.113556.1.4.803:</b> and <b>:1.2.840.113556.1.4.804:</b> to define a bitwise filter.</a>

<a href="/article/jsifaq/jsi-tip-9914-adfind-exe-freeware-allows-you-to-save-and-recall-query-filters-.aspx"><b>ADFind.exe</b> freeware allows you to save and recall query filters.</a>