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

by Bharat Suneja

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

{ 1 comment… read it below or add one }

Anonymous March 26, 2007 at 3:59 pm

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.

Reply

Leave a Comment

Previous post:

Next post: