• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 468
  • Last Modified:

EmailAddresses - Search and remove addresses containing @example.com

I am trying to write a powershell script that will search for emailaddresses containing @example.com in the emailaddresses attribute of Exchange 2007 users. I have a script to find these based on my other criteria, but my question is more how to I remove just these addresses that are mixed in with other addresses that need to remain?

1 Solution
If you have an email address policy for @example.com then I suggest you remove that first otherwise the @example.com is likely to come back again
Muzafar MominCommented:
You should go through the proxyaddresses. I'm on mobile today but if you Google powershell remove SMTP email address there are some good scripts .. Basically this is what you do.

FOreach proxyaddress
If address = '*@example.com'
Endif etcetc..
kevster5Author Commented:
MegaNuk3 - thanks...I already removed that email address policy. Someone added it in to cause the problem I now need to cleanup. Thanks for the tip though.

P_nuts...i'll give that a shot and let you know what I find...hopefully it'll help others one day searching.
Did you find it?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Tackle projects and never again get stuck behind a technical roadblock.
Join Now