Clean users email addresses from old domains

So you have lots of domains in your exchange environment that you don’t use anymore. Well you remove them from the accepted domains and what do you know. They still exist on all the users. So how do we clean this up. Well I wrote a small Powershell script that does just that.

Lets start with getting all accepted domains:

And now just list all addresses that are wrong:

And now just rerun the script altered so it removes the addresses instead:

Leave a Reply