Posted by: Anthony Drewery | November 3, 2006

VBScript to remove specific SMTP proxy addresses

This script will remove proxy addresses for a specific SMTP domain from a specified list of users. You can change the domain by editing the strSMTPDomain value in the script. The input file called users.txt is a list of display names. For my needs I reformatted the output from my previous script. By specifying the domain and the list of users it reduces the chances of any mistakes.

The script takes the input file and processes each listed user. It checks all the proxy addresses for the user and deletes any that match the specified domain. Two output files are produced. The first is a processing log which lists whether each user was found and how many addresses were removed for that user. The second file is a log of all addresses removed which can be used as a reference in the event of a mistake.

You can download the script here: StripLegacyProxyAddresses.vbs.txt


Responses

  1. I am getting the following error when executing the StripLegacyProxyAddress.vbs. I renamed the script Stripproxyaddresses.vbs:

    I also replaced the strSMTPDomain to strSMTPDomain = “Apple.com”

    Stripproxyaddresses.vbs(1, 1) Microsoft VBScript compilation error: Expected statement

    The users.txt file is in the C:\ and is as follows:
    [users.txt]
    Test smtp:Test@Apple.com
    Test smtp:Test@Test.com
    Test smtp:Test@plume.com
    Test2 smtp:Test2@Apple.com
    Test2 smtp:Test2@Test.com
    Test2 smtp:Test2@plume.com

    I also tried the following:
    [users.txt]
    Test
    Test2

    Any suggestions? I am wanting to remove SMTP addresses from all users in our domain.

    Sam

  2. Big thanks for your script !

  3. Can this script be modified to read an excel spreadsheet? What I am looking to do is to removed smtp addresses from users that I have on a spreasheet. The spreadsheet as the samid, dn and the smtp address to remove.

  4. Thankyou very much! it works wonderful. just that i need.

  5. Thanks for this series of scripts. I’m not a ‘scripter’ but yours helped me remove a legacy smtp address from about 250 of our 200+ users!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: