Delete the old SMTP domain from the Exchange 2007 mailbox
This article is made based on the following situation: the company or organization where you work has experienced many sales and changes over the years. During that process, some SMTP domains were no longer owned, and therefore must be removed from the Accepted Domains list in Exchange 2007 and E-mail Address Policies ...
TipsMake.com - This article is made based on the following circumstances: the company or organization where you work has experienced many sales and changes over the years. During that process, some SMTP domains were no longer owned, and therefore must be removed from the Accepted Domains list in Exchange 2007 and E-mail Address Policies. But the problem is that when you do this, it is impossible to delete the email addresses that were associated with the mailbox data section of the user.
For more specific examples, company A sold a branch that operates with the OLDDOMAIN.com domain, so Company A no longer owns that domain and will need to remove all The component is related to OLDDOMAIN.com from the system.
Screenshot of the properties of any account before we continue processing
Because in fact, there is no function to remove the old domain from the system from the user's E-mail Addresses list (also known as ProxyAddresses ), we can handle it manually in each mailbox section. to remove old address components, or use PowerShell for batch processing.
Some assumptions are made based on user needs:
- You want to use this function on each domain mailbox
- You have full administrative rights or at least have the right permissions to manage the entire mailbox section
- Use this function from Exchange Management Shell
- Replace OLDDOMAIN.com with the domain name component you want to remove from the email address
The code used in this hypothetical situation is as follows:
#Get all mailboxes into an Array
$ mbxs = @ (get-mailbox -Resultsize Unlimited)
#Iterate through each mailbox
foreach ($ mbx in $ mbxs)
{
#Create hai ảnh trong các địa chỉ thư trong trả về thư mục
$ CurrentList = $ mbx.emailaddresses
#the second copy is the one where changes will take place.
$ NewList = $ mbx.emailaddresses
#Iterate qua mỗi địa chỉ trong danh sách danh sách.
foreach ($ Address in $ CurrentList)
{
#see if địa chỉ hiện thời được kết thúc các trường bạn muốn gỡ bỏ
if ($ Address.tostring () -match "OLDDOMAIN.com")
{
#If được tìm thấy match, gỡ bỏ địa chỉ từ từ danh sách.
$ NewList - = $ Address
}
}
#Overwrite the old list with new list.
set-mailbox $ mbx -emailaddresses $ NewList
}
When the test is completed with the newly provided code, the results are very positive, so it will be very effective when applied in practice.
The entire section of OLDDOMAIN.com SMTP address has been successfully deleted
But everyone should keep in mind that the above code only works on Exchange 2007 platform, doesn't work with Exchange 2010. Wish you success!
You should read it
- Learn about Mailbox Recovery Exchange 2010
- Mailbox Exchange 2007 SP1 management features
- How to set up SMTP server to send email using Outlook.com address
- Limit Spam with the Sender Reputation in Exchange 2007
- Secure secure SMTP mail flow between different Exchange Server 2007 organizations
- Import PST file into Exchange 2010
- Managing Resource Mailboxes in Exchange Server 2007 (Part 2)
- Transfer Exchange 2003 to Exchange 2007 (Part 2)
- Replace Domino with Exchange 2007 (P.5)
- Use the RecoverServer switch to restore Exchange 2007
- Managing Resource Mailboxes in Exchange Server 2007 (Part 1)
- Transfer Exchange 2003 to Exchange 2007 (Part 1)