Finding SMTP Addresses

If you're looking for my blog entry on finding SMTP addresses, I've removed it in favour of a much more detailed article that I've written over at msexchange.org.  Check it out!

Account Deleted on August 14, 2003 at 04:18 AM in How-Tos
« Outlook and Exchange 2003 | Main | Exchange & Catch-all Mailboxes »

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8345191a569e200e5501fc06d8833

Listed below are links to weblogs that reference Finding SMTP Addresses:

Comments

tried all of the above but didn't find the address missing address

Ran ldp and used (proxyAddresses=smtp:address@domain.com) but it didn't even find addresses that I know exist.

Any ideas

Thanks

Declan

Posted by: Declan at Nov 4, 2003 2:28:46 AM

Here is the script I wrote to find a proxy address. I have six user domains so that is why the query is run 6 times, but this way it searches the entire forest in one script query.

@echo off
setlocal
rem Version 1.2
if /i not .%1. == .. goto :USAGE
if not exist c:\temp md c:\temp
pushd c:\temp
set outdir=c:\temp
echo.
:SERVER
set /p server=Enter GC to query:

REM //VERIFY NETWORK CONNECTIVIY
ping %server% -n 1 | find /i "Reply from" >> nul
if .%ERRORLEVEL%.==.1. (echo ERROR: Cannot ping server. Verify connectivity to %server% & goto :SERVER)
:ADDRESS
set /p address=Enter SMTP address to locate:
echo.
echo Querying domain1.com
ldifde -s %server% -t 3268 -f %outdir%\output1.txt -d "dc=domain1,dc=com" -p subtree -l proxyaddresses,mail,homemdb -r (proxyaddresses=SMTP:%address%) >nul
echo Querying domain2.com
ldifde -s %server% -t 3268 -f %outdir%\output2.txt -d "dc=domain2,dc=com" -p subtree -l proxyaddresses,mail,homemdb -r (proxyaddresses=SMTP:%address%) >nul
echo Querying domain3.com
ldifde -s %server% -t 3268 -f %outdir%\output3.txt -d "dc=domain3,dc=com" -p subtree -l proxyaddresses,mail,homemdb -r (proxyaddresses=SMTP:%address%) >nul
echo Querying domain4.com
ldifde -s %server% -t 3268 -f %outdir%\output4.txt -d "dc=domain4,dc=com" -p subtree -l proxyaddresses,mail,homemdb -r (proxyaddresses=SMTP:%address%) >nul
echo Querying domain5.com
ldifde -s %server% -t 3268 -f %outdir%\output5.txt -d "dc=domain5,dc=com" -p subtree -l proxyaddresses,mail,homemdb -r (proxyaddresses=SMTP:%address%) >nul
echo Querying domain6.com
ldifde -s %server% -t 3268 -f %outdir%\output6.txt -d "dc=domain6,dc=com" -p subtree -l proxyaddresses,mail,homemdb -r (proxyaddresses=SMTP:%address%) >nul
copy %outdir%\output1.txt +%outdir%\output2.txt +%outdir%\output3.txt +%outdir%\output4.txt +%outdir%\output5.txt +%outdir%\output6.txt %outdir%\outputfinal.txt >nul
echo.
echo.
type %outdir%\outputfinal.txt

rem //Cleanup
del %outdir%\output1.txt %outdir%\output2.txt %outdir%\output3.txt %outdir%\output4.txt %outdir%\output5.txt %outdir%\output6.txt
del %outdir%\outputfinal.txt
endlocal
popd

goto :EOF

:USAGE
echo SMTP Address Locator Version 1.2
echo No switches required. Just run the script.

:EOF

Posted by: Scott Bueffel at Nov 5, 2003 3:33:19 PM

vbscript to list all smpt addresses (minus systemmailboxes).

past text between [script] and [/script] into a textfile. call it enumsmtp.vbs

exectute from command line with cscript enumsmtp.vbs

Hope it helps someone.

[script]
vbComma = chr(44)

Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCOmmand.ActiveConnection = objConnection
' change 'LDAP://DC=your,DC=Domain' to the correct values, ie my domain is nna.imrac.net
objCommand.CommandText = _
"Select mail, cn, ProxyAddresses from 'LDAP://DC=nna,DC=imrac,DC=net' " _
& "where mail='*@*' ORDER BY cn"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Timeout") = 30
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Wscript.Echo "Name" & vbcomma & "SMTP"
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
i = 0
Do Until objRecordSet.EOF
strName = objRecordSet.Fields("cn")
Set regEx = New RegExp ' Create regular expression.
Set regEx1 = New RegExp ' Create regular expression.
regEx.Pattern = "^smtp:" ' Set pattern.
regEx1.Pattern = "^SMTP:SystemMailbox{" ' Set pattern.
regEx.IgnoreCase = True ' Set case sensitivity.
regEx1.IgnoreCase = True ' Set case sensitivity.
'go through each of the elements in ProxyAddresses only keep those that start with smpt:
arrProxylist = objRecordSet.Fields("ProxyAddresses").Value
For each Addy in arrProxylist
retVal = regEx.Test(Addy) ' Execute the search for smtp:.
If retVal Then
retVal1 = regEx1.Test(Addy) ' Execute the search for SystemMailbox.
If NOT retVal1 Then
i = i + 1
wscript.echo strName & vbComma & Addy
End IF
End If
Next
objRecordSet.MoveNext
Loop
wscript.echo
[/script]

Posted by: Matt at Dec 23, 2003 2:21:34 PM

hi

Posted by: exch at Feb 11, 2004 3:01:26 AM

Scott: Thanks! Works great!

Posted by: PaalB at Oct 28, 2004 4:43:53 AM

You can do this in Exchange 2007 through the Management console using this command

Get-Recipient -Identity user@domain.com

Posted by: AJbiz at Feb 25, 2010 3:21:39 AM

the technology of internet has brought many advantages and one such is getting the address of the person you have lost touch with for a long time.

Posted by: how to find a missing person at Dec 15, 2010 9:47:06 AM