Solved

remove x400 addresses from exchange 2010 environment

Posted on 2013-01-14
16
2,382 Views
Last Modified: 2013-01-16
Dear All,

I want to delete all X400 address from my environment, I have only exchange 2010 in my environment.

I follow the following link to delete the addresses:
http://www.msexchange.org/articles-tutorials/exchange-server-2010/management-administration/x400-addresses-exchange-2010-part2.html

I apply the following command line:
ForEach ($mbx in (Get-DistributionGroup -ResultSize Unlimited)) {
      $addrs = $mbx.EmailAddresses | Where {$_.Prefix -ne "X400"}
      Set-DistributionGroup $mbx -EmailAddresses $addrs}

I got the following error:

error

Please I need your help to delete all X400 address using PowerShell for mailboxes & groups, I don’t want to use ADModify

Thanks
0
Comment
Question by:Rhala
  • 9
  • 7
16 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 38777202
I think you are running Set-DistributionGroup as a continuation of Where. Set-DistributionGroup should be next line..
ForEach ($mbx in (Get-DistributionGroup -ResultSize Unlimited)) {
      $addrs = $mbx.EmailAddresses | Where {$_.Prefix -ne "X400"}
      Set-DistributionGroup $mbx -EmailAddresses $addrs}

Open in new window

Or you can just add semicolon (;) to separate this commands..
ForEach ($mbx in (Get-DistributionGroup -ResultSize Unlimited)) {
      $addrs = $mbx.EmailAddresses | Where {$_.Prefix -ne "X400"};Set-DistributionGroup $mbx -EmailAddresses $addrs}

Open in new window

0
 

Author Comment

by:Rhala
ID: 38777373
Dear Subsun,

thanks for your reply.

i apply the command, but nothing happen, and still the x400 address in all groups there

nothing
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38777401
Change $_.Prefix to $_.Prefixstring and try..
0
 

Author Comment

by:Rhala
ID: 38778489
i change it, it's same, nothing removed.
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38778538
Did you remove the entry for X.400 addresses from Default Address Policy?

Also note the above command will remove X.400 from Distribution Groups not from mailboxes..

For mailboxes run..
ForEach ($mbx in (Get-Mailbox -ResultSize Unlimited)) {

      $addrs = $mbx.EmailAddresses | Where {$_.Prefixstring -ne "X400"}

      Set-Mailbox $mbx -EmailAddresses $addrs

}

Open in new window

0
 

Author Comment

by:Rhala
ID: 38779098
i need to run it for groups now, then for mailboxes.

how to make sure it's not in the default address policy??
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38779692
how to make sure it's not in the default address policy??
You can Check i in Exchange Management Console under Organization Configuration -> Hub Transport, in the Email Address Policies tab.
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38779872
FYI.. I have tested the following script in my lab and it's working fine..
ForEach ($mbx in (Get-DistributionGroup -ResultSize Unlimited)) {
      $addrs = $mbx.EmailAddresses | Where {$_.Prefix -ne "X400"};Set-DistributionGroup $mbx -EmailAddresses $addrs}

Open in new window

Teat Result
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:Rhala
ID: 38782316
i remove x.400 from all email address policy we have, then i apply the commands, but it's still same:

1

2
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38782343
Why Ctrl +C??  it will terminate the script.. To run the script you need to press Enter key until you get the PS prompt again..
0
 

Author Comment

by:Rhala
ID: 38782347
yes, it's working now,,, thanks a lot

what about mailboxes??
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38782354
0
 

Author Comment

by:Rhala
ID: 38782408
Hi Subsun, Commands working perfectly, i just got the three errors below which i hope you can help to solve them:

The proxy address "smtp:khalid@nt.com.sa" is already being used by "ac.local/AC-Contacts/_Khalid M. Al Bal".
Please choose another proxy address.
    + CategoryInfo          : NotSpecified: (ac.local/ACS-Use...Khalid Al-Bal:ADObjectId) [Set-Mailbox], ProxyAddress
   ExistsException
    + FullyQualifiedErrorId : 7EA0AE9,Microsoft.Exchange.Management.RecipientTasks.SetMailbox
    + PSComputerName        : exch-hc-1.ac.local


The proxy address "smtp:mshammari@ac.com" is already being used by "ac.local/AC-UsersSales/Moha
Shammari". Please choose another proxy address.
    + CategoryInfo          : NotSpecified: (ac.local/AC-Use...ays/Shammari:ADObjectId) [Set-Mailbox], ProxyAddress
   ExistsException
    + FullyQualifiedErrorId : EA6AF758,Microsoft.Exchange.Management.RecipientTasks.SetMailbox
    + PSComputerName        : exch-hc-1.ac.local



The proxy address "smtp:mshammari@ac.com" is already being used by
"ac.local/ACS-Userssales/Shammari". Please choose another proxy address.
    + CategoryInfo          : NotSpecified: (ac.local/AC-Use...eel Shammari:ADObjectId) [Set-Mailbox], ProxyAddress
   ExistsException
    + FullyQualifiedErrorId : 617C0F2D,Microsoft.Exchange.Management.RecipientTasks.SetMailbox
    + PSComputerName        : exch-hc-1.ac.local
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38782435
This means the same proxy address is assigned to more than one user, the proxy address should be unique else use will not receive emails.

For example you tried to assign email address khalid@nt.com.sa to mailbox which is already assigned to ac.local/AC-Contacts/_Khalid M. Al Bal.

The proxy address "smtp:khalid@nt.com.sa" is already being used by "ac.local/AC-Contacts/_Khalid M. Al Bal".
0
 

Author Closing Comment

by:Rhala
ID: 38782498
perfect help, very clear, thanks a lot Subsun
0
 
LVL 40

Expert Comment

by:Subsun
ID: 38782514
You are welcome!
0

Featured Post

Why are Office 365 signatures so complicated?

Trying to setup transport rules for Office 365 email signatures and can’t quite figure it out? Having to test the signature over and over? Make things simple by using Exclaimer Cloud - Signatures for Office 365.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
This video discusses moving either the default database or any database to a new volume.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now