no longer needed Domain name

%3CLINGO-SUB%20id%3D%22lingo-sub-1819795%22%20slang%3D%22en-US%22%3Eno%20longer%20needed%20Domain%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1819795%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20are%20in%20the%20process%20of%20final%20preparations%20for%20migration%20of%202000%20odd%20mailboxes%20to%20online%20and%20have%20come%20across%20an%20issue%20of%20an%20unwanted%20domain%20in%20users%20E%20mail%20address%20aliases.%20This%20was%20used%20many%20moons%20ago%20when%20we%20moved%20from%20Lotus%20notes%20to%20Exchange!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20what%20I%20am%20looking%20for%20is%20a%20PowerShell%20script%20to%20remove%20any%20e%20mail%20address%20where%20the%20domain%20extension%20is%20.biz%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyone%20have%20any%20ideas%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1819795%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2013%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1821695%22%20slang%3D%22en-US%22%3ERe%3A%20no%20longer%20needed%20Domain%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1821695%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20easily%20doable%20via%20PowerShell%2C%20however%20you%20need%20to%20handle%20cases%20where%20said%20address%20is%20added%20as%20primary%20SMTP%20address%20differently%20from%20the%20ones%20where%20it's%20a%20secondary%20one.%20For%20the%20former%2C%20you%20will%20need%20to%20replace%20the%20alias%20instead%20of%20directly%20removing%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere's%20a%20short%20code%20sample%20I%20wrote%20a%20while%20back%20that%20might%20help%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.michev.info%2FBlog%2FPost%2F2011%2Fbulk-replacing-proxy-addresses-based-on-a-pattern%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.michev.info%2FBlog%2FPost%2F2011%2Fbulk-replacing-proxy-addresses-based-on-a-pattern%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

We are in the process of final preparations for migration of 2000 odd mailboxes to online and have come across an issue of an unwanted domain in users E mail address aliases. This was used many moons ago when we moved from Lotus notes to Exchange!!

 

So what I am looking for is a PowerShell script to remove any e mail address where the domain extension is .biz

 

Anyone have any ideas?

 

thanks 

2 Replies

This is easily doable via PowerShell, however you need to handle cases where said address is added as primary SMTP address differently from the ones where it's a secondary one. For the former, you will need to replace the alias instead of directly removing it.

 

Here's a short code sample I wrote a while back that might help: https://www.michev.info/Blog/Post/2011/bulk-replacing-proxy-addresses-based-on-a-pattern

@Vasil Michev  thanks for the reply; Fortunately these are never Primary SMTP :) . i will have a play later this afternoon and get back to you....