Remove SMTP addresses from All users

I have a Domain of about 200+ users with Exchange 2007.  I have about 6 or 7 different E-mail domains.  We are working on switching names to a new Single domain.

I made a mistake and Added the wrong domain to Exchange and also created a e-mail address policy to push out the wrong domain name to all the users.  I have now added the correct domain and removed the wrong domain but the addresses still show up under each user.  How can I remove this from the users?

The Domain was lwspas.com and should have been lwspa.com

kwitcomAsked:
Who is Participating?
 
bnditConnect With a Mentor Commented:
Hello kwitcom,

Believe it or not I've done the same thing before...here's how I fixed my situation:

1) I used LDIFDE to export the proxyAddresses for all users in AD. Here's the command "c:\>ldifde -f <path_location> -s <domain_controller> -d "OU=<your_OU>,DC=<your_domain>,DC=<your_domain>" -r "(objectClass=user)" -l "dn,proxyaddresses"
        Example: Extract proxyaddress from the Finance OU in the contoso.com domain
        c:\>ldifde -f c:\userExport.ldf -s DC1 -d "OU=Finance,DC=contoso,DC=com" -r "(objectClass=user)" -l "dn,proxyAddresses"

The userExport.ldf file will look like this when you open it with notepad:

dn: CN=Administrator,CN=Users,DC=contoso,DC=com
changetype: add
proxyAddresses: SMTP:Administrator@contoso.com
proxyAddresses: X400:c=US;a= ;p=contoso Org;o=Exchange;s=Administrator;
proxyAddresses: smtp:postmaster@contoso.com

dn: CN=Jae Pak,CN=Users,DC=contoso,DC=com
changetype: add
proxyAddresses: X400:c=US;a= ;p=contoso Org;o=Exchange;s=Pak;g=Jae;
proxyAddresses: SMTP:Jae@contoso.com

2) Now, I'll assume that your email policy created the SMTP for your 200+ users. Open the .ldf file created in step #1 and do a "Save As" to make a copy of it. Use the "replace" option in notepad to replace the wrong domain with the correct domain as well as change the "changetype" value to "modify". Also, you'll need to add a line containing "replace: proxyAddresses" and a hyphen (-) followed by a blank line at the end of each user. In this example, I'll replace "contoso" with "abc". (NOTE: I use mail merge in MS Word to add the "-" and the "blank" line) Here's the formatted file that will correct the SMTP address for our users:

dn: CN=Administrator,CN=Users,DC=abc,DC=com
changetype: modify
replace: proxyAddresses
proxyAddresses: SMTP:Administrator@abc.com
proxyAddresses: X400:c=US;a= ;p=abc Org;o=Exchange;s=Administrator;
proxyAddresses: smtp:postmaster@abc.com
-

dn: CN=Jae Pak,CN=Users,DC=abc,DC=com
changetype: modify
replace: proxyAddresses
proxyAddresses: X400:c=US;a= ;p=abc Org;o=Exchange;s=Pak;g=Jae;
proxyAddresses: SMTP:Jae@abc.com
-

NOTE: Rember that the "replace:" line, the hyphen "-", and the "blank" line are important parameters for a successful change. Also notice that I only modified and added to this file and didn't not remove anything.

3) Once you've used notepad to make the changes above, you'll need to import the file back into AD. Here's the syntax:
c:\>ldifde -i -f<path_location> -s <domain_controller>
Example:    c:\>ldifde -i -f c:\import.ldf -s DC1

Again, this is only my opinion to solve your issue. I've fixed my issue this way before, and I'm comfortable with LDIFDE. If you're comfortable with this tool, go ahead and give it a shot. However, if you've never used and feel uncomfortable, I would recommend you find a different way of approaching the problem.
0
 
aissimConnect With a Mentor Commented:
You could check out this program called ADModify; great for making bulk changes in active directory:
http://www.codeplex.com/admodify/Release/ProjectReleases.aspx?ReleaseId=6065

Here's the short of it.....start ADModify; select all the necessary users in your domain; you'll be shown a window similar to the user properties you'd see in ADUC; switch to the E-Mail Addresses tab; tick and configure the box labeled 'Remove E-mail Address'....in your case it would be something like "smtp:*@lwspas.com"

But post back if you run into questions.
0
 
aissimCommented:
crap.....I'm sorry - just realized Exchange 2007....that probably won't work =)

When you say you removed the wrong domain, how did you do so? Did you use the Remove-EmailAddressPolicy command in the EMS?
0
 
tdwg98Connect With a Mentor Commented:
You can use:
adfind

adfind -default -rb ou=recipient -f (proxyaddresses=smtp:*@test.com) -mvfilter proxyaddresses=@test.com proxyaddresses -adcsv | admod proxyaddresses:-:{{proxyaddresses}} -unsafe

For more info, see the link below:
http://blog.joeware.net/2006/11/19/718
0
 
AMCUserConnect With a Mentor Commented:
ADModify worked perfectly!
0
All Courses

From novice to tech pro — start learning today.