Archive for October, 2006

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.

Enabling remote connections to a MySQL server

Tuesday, October 24th, 2006

By default MySQL only permits connections from the server on which it resides. Although this makes for good security there may be times when you need to access the database from elsewhere. This might be using ODBC from your office or maybe a script running on a separate web server.

Using a SSH client like PuTTY connect to your MySQL server. You then need to edit /etc/my.cnf (# vi /etc/my.cnf).

Under the [mysqld] section comment or remove the skip-networking line and add the bind-address=IP_of_MYSQLserver line e.g.

[mysqld]
datadir=/var/lib/mysql
socket=/var/run/mysqld/mysqld.socket
bind-address=192.168.99.99
# skip-networking

Save the file then restart the MySQL service (# /etc/init.d/mysqld restart) 

Now using the MySQL admin tool of your choice create your user accounts but specify the host that they will be connecting from. For example if you are creating a user that connects from the IP address 80.65.35.43 the username will be in this format: username@80.65.35.43

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

How to export BlackBerry Enterprise Server licence keys

Wednesday, October 4th, 2006

When run on your BlackBerry Enterprise Server the following command line will export your installed licence keys to a text file. Replace c:\beskeys.txt with the path and filename of your choice.

bcp besmgmt..licensekeys out c:\beskeys.txt -c -T

Thanks go to Doug for this tip.

Technorati Tags: ,