VBScript to change users SMTP addresses

Does anyone have a good example of a vbscript that will get all SMTP addresses listed for a user and append a value at the end of each address?

I.e. A user has two email addresses bsmith@domain.com and bsmith@customdomain.com.  The vbscript would look change each address to bsmith_disabled@domain.com and bsmith_Disabled@customdomain.com

Assumption is the 'Automatically update e-mail addresses based on e-mail address policy' is not checked for the user.
Who is Participating?
mikainzConnect With a Mentor Commented:
see http://www.msexchange.org/articles/Scripting-Exchange-VBScript-ADSI-Part1.html and the following parts 2 and 3 for a whole tutorial.
You could use LDIFDE for the export, edit the SMTP addresses and then use LDIFDE to import the changes back in.  This will export out ALL SMTP addresses;

ldifde -f smtpaddresses.txt -d "dc=domain,dc=com" -l proxyaddresses -r "(proxyaddresses=*)"

But, it sounds like you might be trying to disable SMTP for a select group of users, is that what you are trying to do?   There are ways to do disable Internet email using a security group and some other steps.  If that is your goal, reply back and also with the version of Exchange.  If not, my apologies.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.