2

Is there any elegant way to remove email addresses from users using automation, Powershell or Exchange Email Address Policies? The platform in question is Exchange 2007.

I would like to modify email addresses of departed users so that their address would become [email protected] or something similar, removing their old [email protected] type addresses.

This article (Serverfault; Exchange 2010) suggests addresses are only addded using Email Address Policies, so i assume i'll have to use some other method. Suggestions? Elegant suggestions?

2 Answers 2

1

Here's a PowerShell script to get you started:

$users = get-mailbox -OrganizationalUnit disabled

foreach ($user in $users) {
    $newaddresses = @()
    foreach ($address in $user.emailaddresses) {
        $newaddresses += "SMTP:disabled." + $address.smtpaddress
    }
    $user.emailaddresses.clear()
    foreach ($address in $newaddresses) {
        $user.emailaddresses.add($address)
    }
    set-mailbox -identity $user.identity -emailaddresses $user.emailaddresses
}
0

ADModify can easily accomplish this:

http://admodify.codeplex.com/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .