Solved

remove x400 addresses from exchange 2010 environment

Posted on 2013-01-14
16
2,343 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create a User Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Mailb…
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…

747 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

15 Experts available now in Live!

Get 1:1 Help Now