Export list of primary SMTP addresses
System is Exchange 2003.I have found some details for using ldifde to export a list of all ADusers' SMTP addresses but it lists ALL of these addresses. What we want to do is list ONLY people with addresses with a certain domain name (e.g. @company.com) and then ONLY this one address for each user, not all of their email addresses - e.g. they may also have @company.co.uk and/or @company.local but we don't want these listed.Also, in the same vein, a wayto list all user's primary SMTP address, whether it is the domain name (@company.com) from above or not.Thanks
November 18th, 2009 1:14am

ldifde -f proxies.txt -d "dc=domain,dc=com" -l proxyaddresses -r "(proxyaddresses=*smtp:*@company.com)" Check this one probably this should help you http://support.microsoft.com/kb/318774Vinod |CCNA|MCSE 2003 +Messaging|MCTS|ITIL V3|
Free Windows Admin Tool Kit Click here and download it now
November 18th, 2009 4:49pm

Hi, Based on my research, we do not have tool to only export an email address in the ProxyAddress attribute currently. Nevertheless, I think that you can develop a script to scan the exported result and save only email address with a certain domain. Regarding develop a script, I suggest you post your question to develop forum. ~~~~~~~~~~~~~~~~ Mike Shen TechNet Subscriber Support in forum If you have any feedback on our support, please contact tngfb@microsoft.com ~~~~~~~~~~~~~~~~
November 19th, 2009 5:29am

Bear with me as I'm doing this from memory. Could you use ADUC? Start ADUC and add the PRIMARY SMTP ADDRESS column. Add/remove other columns as desired, then right click the OU and select Export List... This will create a txt file of everything displayed.
Free Windows Admin Tool Kit Click here and download it now
November 19th, 2009 9:20pm

Agree with Lord_Vader. This can be done from ADUC , where as you can create a query to get all the users and then from add and remove coloumn , you can add email address and then export the list to a csv file.If you have the Saved queryfolder in teh Active Directory Users and computersSnap-in then you can do this:1. Right-Click the folder and select New query2. Give it a descriptive name3. Click Define Query4. From the drop down list select Custom Search5. Clcik Advanced tab6. Paste in the following:(&(objectCategory=user)(memberOf=cn=Domain Admins,cn=users,dc=YourDomain,dc=local))You will need to change the cn=..... part to suite your groups distinguished name.then once you save this and get a list you can:7. Right-click on your query 8. Select Export List (not Export Query definition as this just createsa backupof the query)9. Select from the save as type: Text (Comma Delimited) (*.csv)Which of course, opens in Excel as it is.Raj
November 19th, 2009 9:42pm

Hi Raj and Lord_Vader, Thanks for your response. I would like to explain that there is noPRIMARY SMTP ADDRESS column can be selected by using ADUC. We can only select E-mail Address column which actually use the Mail attribute of the userobject.The Primary SMTP Address is actually saved in the ProxyAddress attribute of user object. Although, the Mail Attribute should be same as the Primary SMTP Address by default. Nevertheless, in some particular situation, the two atttributes may be different. Thanks,Mike
Free Windows Admin Tool Kit Click here and download it now
November 20th, 2009 11:44am

On Fri, 20-Nov-09 08:44:42 GMT, Mike Shen wrote:y be different. Thanks,Mike Finding the ones that differ is fairly easy -- just increase thediagnostics logging on the MSExchange SA \ OAL Generator. When thevalues differ the OAL Gen throws an event into the application log.I haven't found a legitimate reason for the values to differ in thelast thirteen years. I HAVE found where the differences causeproblems, just as I've seen issues when non-mail-enabled AD objectshad a populated "mail" property.---Rich MatheisenMCSE+I, Exchange MVP--- Rich Matheisen MCSE+I, Exchange MVP
November 20th, 2009 10:49pm

I have used this guy's script a number of times for these kind of situations, it will go thru and dump out all the smtp addresses to a file.http://blog.drewery.net/2006/10/27/vbscript-to-export-smtp-proxy-addresses/You can run this script to output all of the smtp addresses to a file and then use a find /I command to get either the primary smtp "SMTP" or the specific domain "@domain.com".ThanksWillWill Shepherd - MCSE/MCITP/MCTS (Windows 2008,Exchange 2007,OCS 2007)
Free Windows Admin Tool Kit Click here and download it now
November 20th, 2009 10:58pm

On Fri, 20-Nov-09 19:58:14 GMT, Will Shepherd wrote:>I have used this guy's script a number of times for these kind of situations, it will go thru and dump out all the smtp addresses to a file.http://blog.drewery.net/2006/10/27/vbscript-to-export-smtp-proxy-addresses/You can run this script to output all of the smtp addresses to a file and then use a find /I command to get either the primary smtp "SMTP" or the specific domain "@domain.com".ThanksWill>Will Shepherd - MCSE/MCITP/MCTS (Windows 2008,Exchange 2007,OCS 2007) of these are, admittedly, "corner cases", but I've stumbled onthem before. Item #3, however, means you never get the primary SMTPproxy addresses!1. I'd set the "page size" to 1000 or less. Some folks still have oldDCs and the 1500 value won't work.2. The assumption that the "proxyAddresses" property will always bepopulated with more than 1 value. If there's only one address in theproperty the value returned is a scalar, not an array. That'll causethe "For Each Address" to process no addresses.3. Comparisons are case sensitive. The 'If left(Address,5)= "smtp:"'should be changed to 'If LCase(left(Address,5))= "smtp:"'. If that'snot done you'll only get secondary SMTP addresses. If you want ONLYthe primary SMTP proxy addresses then the condition should be 'Ifleft(Address,5)= "SMTP:"' (with the address type in upper case).4. The constant "filepath" tries to write to the root of the C: disk.That'll need changing if the local machine doesn't allow writing theret).---Rich MatheisenMCSE+I, Exchange MVP--- Rich Matheisen MCSE+I, Exchange MVP
November 21st, 2009 1:19am

I've always used this script after a migration to help cleanup domains that were used to route email during co-existance and even removing old domainsso the issue of only 1 proxyAddress wasn't a concern. As for the compairson being case sensitive this isn't the case, I just used it last week and it pulled all smtp addresses including the primary one.ThanksWillWill Shepherd - MCSE/MCITP/MCTS (Windows 2008,Exchange 2007,OCS 2007)
Free Windows Admin Tool Kit Click here and download it now
November 21st, 2009 5:15pm

On Sat, 21-Nov-09 14:15:50 GMT, Will Shepherd wrote:>I've always used this script after a migration to help cleanup domains that were used to route email during co-existance and even removing old domains so the issue of only 1 proxyAddress wasn't a concern. Perhaps not, but it may be for others. I know that I have severalmail-enabled users in the AD with only a single proxy address.mary one.ThanksWill>Will Shepherd - MCSE/MCITP/MCTS (Windows 2008,Exchange 2007,OCS 2007) You saw upper-case "SMTP" address types in the output? I didn't when Iran it. Until I forced a case-insensitive comparison by using theLCase operator I saw only lower-case 'smtp' address types in theoutput.I just ran it again and confirmed that.---Rich MatheisenMCSE+I, Exchange MVP--- Rich Matheisen MCSE+I, Exchange MVP
November 21st, 2009 9:03pm

Your right, it doesn't pull the "SMTP", I was looking at the output from a different script that I ran to get the primary address.ThanksWillWill Shepherd - MCSE/MCITP/MCTS (Windows 2008,Exchange 2007,OCS 2007)
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2009 6:47pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics