for /?
An excerpt thereof:
FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do
@echo %i %j %k
would parse each line in myfile.txt,
ignoring lines that begin with
a semicolon, passing the 2nd and 3rd token from each line to the for
body, with tokens delimited by commas and/or spaces. Notice the for
body statements reference %i to get the 2nd token, %j to get the
3rd token, and %k to get all remaining tokens after the 3rd. For
file names that contain spaces, you need to quote the filenames with
double quotes. In order to use double quotes in this manner, you also
need to use the usebackq option, otherwise the double quotes will be
a semicolon, passing the 2nd and 3rd token from each line to the for
body, with tokens delimited by commas and/or spaces. Notice the for
body statements reference %i to get the 2nd token, %j to get the
3rd token, and %k to get all remaining tokens after the 3rd. For
file names that contain spaces, you need to quote the filenames with
double quotes. In order to use double quotes in this manner, you also
need to use the usebackq option, otherwise the double quotes will be
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Teo De Las Heras
Sent: Saturday, February 11, 2006 12:05 PM
To: [email protected]
Subject: Re: [ActiveDir] ds* or joeware to get DN from email address
Joe and Hunter, thanks for the reply. Is it possible to feed the
query the SMTP address from a file? Something similar to:
c:\>type smtp_addresses.txt | adfind -gc -b -f
"&(objectCategory=person)(proxyaddresses=<get this from
smtp_addresses.txt>)" -dn
Thanks!
Teo
On 2/10/06, joe
<[EMAIL PROTECTED]>
wrote:
If you want to match on any smtp address (primary or any secondaries)adfind -gc -b -f "&(objectCategory=person)( proxyaddresses=smtp:[EMAIL PROTECTED])" -dnThat will hit every domain in the forest too.
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Coleman, Hunter
Sent: Friday, February 10, 2006 5:23 PM
To: [email protected]
Subject: RE: [ActiveDir] ds* or joeware to get DN from email address
adfind -default -f "&(objectCategory=person)(mail= [EMAIL PROTECTED])" dnYou can change your search base as necessary. This also assumes that you want to check the primary SMTP address, and not match on a secondary address.
From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Teo De Las Heras
Sent: Friday, February 10, 2006 2:50 PM
To: [email protected]
Subject: [ActiveDir] ds* or joeware to get DN from email address
Are there any tools out there that can get me the DN from an email address?I can write a script for this pretty easily, but I want to hand the task off to another admin that does not know scripting. Having him use pre-existing tools will simplify things.Teo
