HOW TO: Remove values from multi-valued properties using Exchange shell

Related to the previous posts “HOW TO: Add additional email addresses to a recipient” and “HOW TO Update multi-valued attributes in PowerShell” – removing one or more values from a multi-valued property is equally easy (though not a one-liner… ). The following example shows you how to remove a domain from the list of BypassedSenderDomains – a multi-valued property of ContentFilterConfig:

$foo = Get-ContentFilterConfig
$foo.BypassedSenderDomains -=”somedomain.com”
$foo | Set-ContentFilterConfig

Similarly, removing a proxy email address:

$mailbox = Get-Mailbox User1
$mailbox.EmailAddresses -=”[email protected]
$mailbox | set-mailbox

Written by

Bharat Suneja

0 Comments

  1. Anonymous

    Hi,

    I’m new to the powershell, so sorry for asking, but how do you use these lines in a script ? So that you can create scripts like:

    add-bypassedsender [e-mail]
    remove-bypassedsender [e-mail]

    I’ve tried creating a ps1 script with e-mail as parameter but that didn’t work, got all kinds of errors.

    Frank.

Leave a Comment

Your email address will not be published. Required fields are marked *