Link to home
Start Free TrialLog in
Avatar of advserver
advserverFlag for United States of America

asked on

Powershell script to remove email address from Exchange 2007 user.

I have Exchange 2007 mailboxes that have been attached to Active Directory user accounts.

The users had mail contacts before attaching the mailboxes.

A script was run to delete the mail contacts, attach the mailboxes, and add the smtp addresses that were found in the mail contact.

There are now two similar addresses in the "email addresses" tab where one needs to be removed.  

The two addresses look like this: "" and ""

I need a script which imports a csv where the user's alias is in one column and the desired email address alias is in the second column.  The script calls the csv and removes the appropriate "" for the specified users.
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

So you have...


Is the address specified in the CSV the one you want to keep? Or the one you want to remove? And if it's the one to keep, everything else should be removed?

And you mention both contacts and users here, it makes little difference, but are these users or contacts?

Avatar of advserver


The contacts are gone and we are left with the Exchange 2k7 mailbox.

The Exchange 2k7 mailbox now has 2 similar email addresses and represents the address used in the mail contact which was deleted represents the address set by default when the Exchange 2k7 mailbox was created.

I need to have the deleted for every user specified in a csv file.

"User2" is the alias of the user which would have to be called in the csv and as the user has two emails that end with "" the full email address would probably have to be in the csv as well.

I know it's a random request but thank you for your time!
I still wasn't that clear.

User2 = Exch2k7 Mailbox

Email addresses for User2:,

Need to have every specified user's alias email address deleted  ie: deleted

Avatar of advserver
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial