HOW TO: Remove values from multi-valued properties using Exchange shell
Posted by Bharat Suneja at 9:37 AM
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
$mailbox = Get-Mailbox User1
$mailbox.EmailAddresses -="[email protected]"
$mailbox | set-mailbox
Labels: Administration, Anti-Spam, Exchange Server 2007, Exchange Shell
1 Comments:
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.
Post a Comment
Links to this post:
Create a Link
<< Home