[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

remove x400 addresses from exchange 2010 environment

Posted on 2013-01-14
16
Medium Priority
?
2,758 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 7
16 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 2000 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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
 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
In this video we show how to create a Contact 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 >> Contact ta…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses

656 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