locked
Should modifying an email address policy also remove e-Mail addresses from user profiles?

    Question

  • I am noticing that when I modify our standard corporate email address policy in Exchange 2010, via the EMC, I am able to apply the changes to all the email enabled account, groups, resources, etc.   However, if I remove one of the email addressing formats in the template and then attempt to apply that to all the same email-enabled resource, it does not remove the email address template.

    I'm assuming this isn't the expected behavior when modifying E-Mail Address policies?  Also, our small organization appears to have three separate policies; Defauly Policy and then two additional ones.   Is there any good reason for a small (< 50 mailboxes) organization to have any more than just the default policy?


    • Edited by onetech-it Sunday, March 25, 2012 11:39 PM
    Sunday, March 25, 2012 11:39 PM

Answers

  • On Mon, 26 Mar 2012 18:49:54 +0000, onetech-it wrote:
     
    >Given this fact, is there a way to bulk remove email addresses from each user's mailbox (i.e. if we remove a certain domain from our corporation and I wanted to remove the '@olddomain.com' email address from all recipients in Exchange, by using the ESM?
     
    Use ADModify to do that. You'll spend a lifetime doing it one mailbox
    at a time with the ESM. :-)
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Tuesday, March 27, 2012 2:28 AM
  • Hello,

    Maybe you can use this to remove the email address:

     $users=get-mailbox -resultsize unlimited
     
     foreach($user in $users){
     
     $user.EmailAddresses | where{$_.AddressString -like '*@olddomain.com'}| foreach{
     
     Set-mailbox $user -EmailAddresses @{remove=$_}
     
        }
     
     }

    Thanks,

    Evan


    Evan Liu

    TechNet Community Support

    Tuesday, March 27, 2012 7:29 AM
    Moderator

All replies

  • On Sun, 25 Mar 2012 23:39:07 +0000, onetech-it wrote:
     
    >
    >
    >I am noticing that when I modify our standard corporate email address policy in Exchange 2010, via the EMC, I am able to apply the changes to all the email enabled account, groups, resources, etc. However, if I remove one of the email addressing formats in the template and then attempt to apply that to all the same email-enabled resource, it does not remove the email address template.
     
    That's correct. Just becasue you aren't assigning any new addresses
    doesn't mean that new e-mail won't arrive addressed to the addresses
    that thre previously assigned.
     
    >I'm assuming this isn't the expected behavior when modifying E-Mail Address policies?
     
    Ye, it is.
     
    >Also, our small organization appears to have three separate policies; Defauly Policy and then two additional ones. Is there any good reason for a small (< 50 mailboxes) organization to have any more than just the default policy?
     
    That depends on what the policies are doing. Perhaps you have a
    different policy for groups?
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Monday, March 26, 2012 4:00 AM
  • Given this fact, is there a way to bulk remove email addresses from each user's mailbox (i.e. if we remove a certain domain from our corporation and I wanted to remove the '@olddomain.com' email address from all recipients in Exchange, by using the ESM?
    Monday, March 26, 2012 6:49 PM
  • On Mon, 26 Mar 2012 18:49:54 +0000, onetech-it wrote:
     
    >Given this fact, is there a way to bulk remove email addresses from each user's mailbox (i.e. if we remove a certain domain from our corporation and I wanted to remove the '@olddomain.com' email address from all recipients in Exchange, by using the ESM?
     
    Use ADModify to do that. You'll spend a lifetime doing it one mailbox
    at a time with the ESM. :-)
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Tuesday, March 27, 2012 2:28 AM
  • Hello,

    Maybe you can use this to remove the email address:

     $users=get-mailbox -resultsize unlimited
     
     foreach($user in $users){
     
     $user.EmailAddresses | where{$_.AddressString -like '*@olddomain.com'}| foreach{
     
     Set-mailbox $user -EmailAddresses @{remove=$_}
     
        }
     
     }

    Thanks,

    Evan


    Evan Liu

    TechNet Community Support

    Tuesday, March 27, 2012 7:29 AM
    Moderator
  • Hello! great script, worked good for me. What could i change to run this on Contacts instead? is there a $contact variable like your $user variabel.

    Best Regards

    Lars-Göran

    Tuesday, August 19, 2014 10:13 AM
  • Instead of "Get-Mailbox" use "Get-MailContact".

    --- Rich Matheisen MCSE&I, Exchange MVP

    Tuesday, August 19, 2014 7:37 PM
  • Thanks for answer, this is what i ran.

    This first

    Get-MailContact -resultsize unlimited | ForEach-Object {Set-MailContact -Identity $_.Name -EmailAddre
    sPolicyEnabled $false}

    This Second.

    $Contacts = get-mailcontact -resultsize unlimited

     foreach($user in $contacts){

     $user.EmailAddresses | where{$_.AddressString -like  '*@domain.no'}| foreach{

     Set-mailcontact $user -EmailAddresses @{remove=$_}

        }

     }

     I got som error with corrupted contacts, but after they were taken care of it worked fine.

                
    Thursday, August 21, 2014 7:25 AM