Microsoft Exchange Server 2016 PowerShell Cookbook - Fourth Edition
by Jonas Andersson, Nuno Mota, Mike Pfeiffer
How it works...
Adding and removing email addresses was more challenging back in the days of the Exchange 2007 management shell because it required that you work directly with the EmailAddresses collection, which is a multivalued property. In order to modify the collection, you first had to save the object to a variable, modify it, and then write it back to the EmailAddresses object on the recipient. This made it impossible to update the email addresses for a recipient with one command.
The Set-* cmdlets used to manage recipients in Exchange 2016 now support a new syntax that allows us to use a hash table to modify the EmailAddresses property. As you can see from the code samples, we can simply use the Add and Remove keys within the hash ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access