Link to home
Start Free TrialLog in
Avatar of MCPJoe
MCPJoeFlag for United States of America

asked on

Export complete list of SMTP addresses

I need to export from AD or Exchange a complete list of SMTP addresses.  This includes all SMTP addresses, not just the primary.  Some my my users and DL's have more than one SMTP address.  I'm having trouble getting the saved queries or even adding the e-mail address column to ADUC.  Any suggestions or tips?

Thanks
Avatar of trenes
trenes
Flag of Netherlands image

Hi MCPJoe,

Do this in command prompt.

dsquery user | dsget user -email


Cheers!
SOLUTION
Avatar of redseatechnologies
redseatechnologies
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MCPJoe

ASKER

All I get are 100 default entries in the output, what syntax do I use the -limit argument to get all my records?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The script I posted would be a little easier again - all you have to do it run it :)
Avatar of MCPJoe

ASKER

All I really need to do is generate a list of SMTP addresses, I don't need to get the username or anything else.  ADUC saved queries only shows me the primary e-mail address.  The VB script above doesn't show me anything.  I get an error.  The link to a VB script near the top exported a list, but only of 100 or so, not nearly my complete listing.  I have multiple containers my Exchange objects are in, I need a global export of all SMTP address, and only SMTP addresses, nothing else.  Any other ideas?
Avatar of MCPJoe

ASKER

redseattechnologies - I need a listing of all SMTP addresses, your script in the link only did an output of user SMTP addresses, and none of the ones it output had more than 1 address, and I know we have several users who have more than one SMTP address, but no more than 4.  I also need SMTP addresses for mail enabled groups (DL) and also mail enabled public folders not just user accounts.
Indeed, that script will not get DL addresses.

Why you are having problems with it, I don't know.  As it wont get DLs, there is little point troubleshooting it

-red
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
However -- redseatechnologies has got some excellent scripting solutions for quite a number of issues across the entire network.  I've just never learned code so I use the resources available to me.  He has provided me some great utilities!!!!
Avatar of MCPJoe

ASKER

Yeah I agree, the script was great, just not completely what I need.  I found this one - http://www.drewery.net/blog/2006/10/27/vbscript-to-export-smtp-proxy-addresses/

That works good, but not setup for public folders or DLs.  If I knew LDAP well enough I could probably set it up to do what I need.  Any LDAP guru's out there have any tips or code available that would take the code in the above link and add public folder and DL selections to the query?
-red
I do like this code !!!  ... but it doesn't give me the secondary addresses.  
Really?

I didn't write it, but let me test it out and see what is going on

-red
Try this version (later on in the page)

http://www.visualbasicscript.com/fb.aspx?m=34353

It has to be run on a machine with Excel (doesn't have to be a DC though)

-red
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial