Archive for the 'Scripts' Category

VBScript to remove specific SMTP proxy addresses

Friday, November 3rd, 2006

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

VBScript to export SMTP proxy addresses

Friday, October 27th, 2006

Part of the way my current employer has grown is through acquisitions and mergers. Consequently we’ve been supporting more than 10 legacy SMTP domains from various shipping lines. Now that we’re decommissioning our systems it’s time to do some housekeeping and discontinue these domains.

The first step was to check that all objects had their primary SMTP address set to the main domain name. This was done more than a year ago but needed to be reconfirmed. A custom LDAP query that included the syntax  (!mail=*@our_main_domain.com) sufficed.

Next I wrote a script that exported all SMTP proxy addresses for user objects. This was to be used as a reference in the unlikely event that problems arose down the line. The LDAP query can easily be modified for groups, contacts and public folders. It’s not the most exciting of scripts but it does the job. You can download it here: AllSMTPProxies.vbs.txt

As I wanted to be very specific and meticulous in the removal of legacy proxy addresses I wrote another script that targets a specific SMTP domain. In this script you can specify the domain by changing the strSMTPDomain value. The script will then only export the names and addresses for proxies that match the SMTP domain. You can download the script here: SpecificSMTPProxies.vbs.txt

In my next post I’ll be using PutEx in a script to remove proxy addresses from AD objects.

VBScript to output the logon script assigned to each user

Tuesday, October 24th, 2006

With some guidance from my colleague Ben Christian I’ve been working on several VBScripts to assist with the decommissioning of our systems. The scripts range from simple reporting to modifying objects. By posting them in this blog someone else may get some use out of them. They are posted "as is" and I accept no liability arising from the use of them.

This script simply creates a tab delimited text file showing all users with their logon script and object’s distinguished name. You’ll be notified by a prompt when the script has finished processing. Simply open the resulting text file with Excel to see the information formatted into columns. You could modify the script to output to a CSV file if you don’t use commas in your display names. Download the script here: WhichLoginScript.vbs.txt