Link to home
Start Free TrialLog in
Avatar of Albert Widjaja
Albert WidjajaFlag for Australia

asked on

How can I safely remove unused secondary domain from 500+ mailboxes ?

Hi, I have removed my secondary domain in my exchange server organizational configurations http://technet.microsoft.com/en-us/library/bb124423(v=exchg.80).aspx 

But somehow it is still appearing in all of the mailboxes in my domain ?

Any idea please to safely remove it from the production mailbox?
Avatar of Chris H
Chris H
Flag of United States of America image

I'm assuming < exchange 2003?  

Remove the domain from any recipient update policies and user accounts.  Or remove from recipient update policies and 'apply this policy now'
Avatar of Albert Widjaja

ASKER

I'm on exchange server 2007 SP1
SOLUTION
Avatar of SubSun
SubSun
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the reply Sembee,

admodify  --> what is that and can I do that automatically for all mailbox in the office ?

Yes I know, as long as it is still running and no issue, I keep it that way, I am afraid to break something if I'm upgrading it into SP3 RU 8
Is Google broken today?
admodify - in your favourite search engine and it will come up as the first hit. It allows bulk changes to the Active Directory.

You are going to have more problems staying on such an old version. The world moves on, staying so out of date because you are scared you are going to break something is not really a good attitude to have. If the server is exposed to the internet in any way then you are putting your data at risk by not keeping it up to date. Hopefully you don't have the same attitude to patching of other systems. That may seem harsh, but I clean up so many sites where system maintenance has not been carried out and they wonder why they have problems. Standing still in the current IT security environment is not an option unless you are completely 100% isolated from the outside world.

Simon.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
wow that's cool jjmck, so where can I put the -WhatIf to check the script before I run it in production ?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks to all
is there any way to modify the script to display which mailbox got the secondary address ?

jjmck, many thanks in advance for the powershell assistance
This will output the display name of the mailbox anytime it finds a mailbox with an SMTP address that contains the domain you specify:

$domain = ""
Get-Mailbox -ResultSize unlimited | % {
	foreach ($address in $_.emailaddresses) {
		If (($address.type -eq "SMTP") -and (($address.Address.Split("@")[1] -eq $domain))) {
			$_.emailaddresses -= [Microsoft.Exchange.Data.ProxyAddress]("smtp:$($address.address)")
			$_.displayname
		}
	}
	Set-Mailbox $_.primarysmtpaddress -EmailAddresses $ProxyAddresses
}

Open in new window


JJ