How to change multivalued properties on Exchange 2010 (SP1,SP2) ?

In my case I wanted to change (add) trusted domains (senders) of Junk mail filter settings for members of distribution group. Set-MailboxJunkEmailconfiguration is the cmdlet for adding (changing) trusted senders and domain for user's outlook safe senders list. TrustedSendersAndDomains is multivalued property and values can be added or removed using following simple syntax without overwriting already populated values:

get-DistributionGroupMember -identity "alias" | Set-MailboxJunkEmailConfiguration -TrustedSendersAndDomains @{Add='emailaddress@domain.name','domain2.name', ...}

get-DistributionGroupMember -identity "alias" | Set-MailboxJunkEmailConfiguration -TrustedSendersAndDomains @{Remove='emailaddress@domain.name','domain2.name',....}

This syntax can be used for changing any multivalued properties not just TrustedSendersAndDomains property.

Comments

Popular posts from this blog

How to convert string to Base64 and vice versa using Powershell

Machine domain group policy failed to apply

Failover Clustering Event 1196 and 1228