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 DEPARTED.firstname.lastname@domain.local or something similar, removing their old firstname.lastname@domain.tld 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?

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
}
| improve this answer | |
0

ADModify can easily accomplish this:

http://admodify.codeplex.com/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.