
Explanation/Reference:
Explanation:
Box 1: This command is used to return a list of users who work in the winery department and store the results in the $Users variable.
Box 2: This command says for each user name, take the user's alias, prepend SMTP: and append
@cohowinery.com and add the new address to any existing addresses ($_.EmailAddresses). For example, for a user with an alias of John.Smith, the following email address would be created:
SMTP:
[email protected]. That would then be added to his existing email address.
Box 3: The following PowerShell cmdlet can be used to define the email address for User1's mailbox:
Set-Mailbox -Identity user1 -EmailAddresses <list of email addresses>.
As Box 2 added the new @cohowinery.com address to the existing @cohovineyard.com address, we can use the $_.EmailAddresses value with the -EmailAddresses parameter instead of manually listing the addresses.
References:
https://technet.microsoft.com/en-gb/library/bb123981(v=exchg.150).aspx