Remove expired email SMTP proxy addresses
Hi, we have 3000 Exchange 2007 mailboxes, and last year we purchased several (15) new domain names that are similar to our company name for new products and services. We added the domain names to Exchange and updated the recipient policy. Unfortunately we have made several changes to a few hundred mailboxes so that they no longer follow the recipient policy and another few where the email addresses have been customised. We now want to remove some (13) of the domain names that we are not using, as we have no intention of using them for most people's email, we only want to keep them for a small number of mailboxes (e.g Info@ and Sales@ ) We don't want to simply apply the recipient policy again, as we have so many exceptions that we would have to rapidly re-enter. 99% of the customisations are to domain names that we are keeping - the 1% is for the generic mailboxes like sales and info and accounts etc. - these will be easy to recreate. Is there a Powershell script that I can create to do this? I want to remove all email addresses in a single domain based on their domain name suffix without re-applying the recipient policy. How can I do this?
May 24th, 2011 8:14am

Example in past thread, create a csv with the samaccountname of all your mailbox users then run the script against it. You can also use admodify, select all users in your domain or any OU or do a custom ldap filter then bulk select your users, email address tab, check remove email address smtp:*@domain.com Get-Content C:\users.txt |Get-Mailbox | foreach{ for ($i=0;$i -lt $_.EmailAddresses.Count; $i++) { $address = $_.EmailAddresses[$i] if ($address.IsPrimaryAddress -eq $false -and $address.SmtpAddress -like "*@olddomain.com*" ) { Write-host("Remove smtp adress: " + $address.AddressString.ToString() ) $_.EmailAddresses.RemoveAt($i) } } Set-Mailbox -Instance $_ } http://social.technet.microsoft.com/Forums/en-NZ/exchangesvradmin/thread/4ca1f6dd-07a9-44ac-a32f-f63d42cfc7d1James Chong MCITP | EA | EMA; MCSE | M+, S+ Security+, Project+, ITIL msexchangetips.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
May 24th, 2011 9:41am

Hi, I recommend you use ADmodify tool to simply delete the SMTP addresses: http://admodify.codeplex.com/ Please remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Thanks Gen Lin-MSFT
May 25th, 2011 4:51am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics