PrepAway - Latest Free Exam Questions & Answers

Which Windows PowerShell command should you insert at l…

Your company uses Microsoft Exchange Online. Employees frequently need to change their primary email
addresses.
The messaging operations team has requested a script to simplify the process of changing email addresses.
The script must perform the following actions:
Obtain employee information from a .csv file that has a header line of
UserPrincipalName,CurrentPrimaryAddress,NewPrimaryAddress.
Change employees’ primary email addresses to the values in the NewPrimaryAddress column.
Retain employees’ current email addresses as secondary addresses.
You create the following Windows PowerShell script to read the .csv file. Line numbers are included for
reference only.

You need to complete the script to meet the requirements.
Which Windows PowerShell command should you insert at line 06?

PrepAway - Latest Free Exam Questions & Answers

A.
Set-Mailbox -Identity $UserPrincipalName -WindowsEmailAddress $NewPrimary

B.
Set-Mailbox -Identity $UserPrincipalName -PrimarySmtpAddress $NewPrimary

C.
Set-Mailbox -Identity $UserPrincipalName -ExternalEmailAddress $NewPrimary

D.
Set-MailUser -Identity $UserPrincipalName -EmailAddresses@{add = “SMTP:” + “$NewPrimary”;
remove=”SMTP:” + “$OldPrimary”}

Explanation:
The following PowerShell cmdlet can be used to change the user1@fabrikam.onmicrosoft.com user’s primary
email address to User1@fabrikam.com. The user1@fabrikam.onmicrosoft.com email address will continue to
function as a secondary email address.
Set-Mailbox -Identity user1@fabrikam.onmicrosoft.com –WindowsEmailAddress User1@fabrikam.com
In this question, the $UserPrincipalName variable is populated with the user’s user principle name. The
$UserPrincipalName variable can be used to populate the –identity parameter in the Set-Mailbox cmdlet.
The $NewPrimary variable is populated with the required new email address of the user. The $ NewPrimary
variable can be used to populate the – WindowsEmailAddress parameter in the Set-Mailbox cmdlet.
https://www.cogmotive.com/blog/office-365-tips/change-primary-smtp-address-without-changingthe-login-name-on-office-365

2 Comments on “Which Windows PowerShell command should you insert at l…

  1. Piet Puk says:

    A
    In cloud environments or in on-premises environments where the recipient isn’t subject to email address policies (the EmailAddressPolicyEnabled property is set to the value False for the recipient), the WindowsEmailAddress parameter updates the WindowsEmailAddress property and the primary email address to the same value.




    0



    0

Leave a Reply