0
votes

We currently have a specific format for how our email addresses are defined, based upon name. This system originated some time ago and is beginning to become a bit of a hindrance.

We would like to move to a new format, based along the line of

<first name initial><second name initial><last name>@organisation.com

However, we dont just want to rename the mailboxes etc, instead we're opting to keep the existing email addresses for all current users, but using the new form for new users. In addition, we want to add a mail alias to all of the mailboxes using the legacy format.

Can anyone suggest a relatively straight-forward way to add these aliases via code? Pulling the user's name details is not an issue, moreso just adding the alias to the mailbox. We're currently running exchange 2003 for most users, but are on the verge of a 2007 migration, and so have the odd user on 2007 also (the two servers are running side by side at present).

I've read that all exchange 2007 management should be done using the 2007 tools and not active directory as was previously the case, so can all of this be performed via the exchange 2007 APIs, even for 2003 "legacy mailboxes" (as termed in exchange)?

Basically I'm just looking for a good direction to go here; I've never really done any coding for exchange. Thanks!

3

3 Answers

1
votes

Here's a MS KB that describes modifying the alias through extended MAPI. It looks like you'll need the Exchange Developers Kit to do this.

http://support.microsoft.com/kb/183249

1
votes

I'm posting this after the question was answered, but is there any reason you didn't just use the recipient policies?

0
votes

In the end I found Powershell was by far the easieast way to go. Here is a skeleton of the script I ended up using showing how to add an additional address to each mailbox:

$mailboxes = get-mailbox | sort Name

foreach($mailbox in $mailboxes)
{
    ...
    # Logic for working out the new address
    ...

    $mailbox.EmailAddresses += $newAddress
    $mailbox | set-mailbox
}

And for completeness, this script was run on the new Exchange 2007 server. My initial concern with adding the addresses to mailboxes residing on the older 2003 server was a non-issue; the legacy mailboxes were updated too.