• 1. London, UK
  • 2. New York, NY
  • 3. Sydney, Australia
  • 4. Melbourne, Australia
  • 5. Moscow, Russia
  • 6. Singapore
  • 7. Paris, France
  • 8. Chicago, IL
  • 9. Hong Kong
  • 10. Houston, TX

Monday, March 19, 2007

 

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

Similarly, removing a proxy email address:

$mailbox = Get-Mailbox User1
$mailbox.EmailAddresses -="somexistingaddress@yourdomain.com"
$mailbox | set-mailbox

Labels: , , ,

1 Comments:

March 26, 2007 3:59 PM
Anonymous Anonymous said...

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