PrepAway - Latest Free Exam Questions & Answers

Which Windows PowerShell command should you insert at line 06?

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 froma. 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”}

42 Comments on “Which Windows PowerShell command should you insert at line 06?

    1. Tony says:

      I think the script is removing the SMTP from the current (old) address. Once you remove the SMTP from the proxyAddress attribute it is non longer primary. Not sure if answer D. is deleting the OldPrimary ?




      0



      0
  1. Paul says:

    This change of Primary Address, is for Exchange Online, but the parameter WindowsEmailAddress says: “The WindowsEmailAddress parameter specifies the Windows email address for this mailbox. This address isn’t used by Exchange.”
    For me it’s B. Any comments?




    1



    0
  2. stan says:

    Okay, finally:

    It cannot be A because windowsemailaddress is not used by exchange.
    It cannot be B because primarysmtpaddress is ONLY used by exchange on-premise < just learned this
    It cannot be C because externalemailaddress is not a property of set-mailbox

    I believe it is D (and the person who made the dump made a type) because EmailAddresses is an array and can be treated as one. Read the question carefully of the exam if you take it. But those are my two cents.




    0



    0
    1. FixyPoo says:

      Agree with this. B cannot be used as it doesn’t support O365

      D does work. Also capitalized SMTP is treated as primary in exchange. This script is not removing the old email address, just what is set as primary.




      0



      0
  3. FishFenly says:

    D is the answer…..

    It is not removing the email address, its simply removing the “SMTP:” prefix. The proxyaddress with “SMTP:” in front of it is the primary.

    eg.

    “SMTP:user@domain.com” = SMTP reply address
    “smtp:user@domain.com” or “user@domain.com” = additional alias




    0



    0
  4. yesman323 says:

    The answer must be B. Here is why

    The question refrains to mailboxes and NOT mail users, so Answer D is not the answer, leaving us A, B , or C.

    C cannot be the answer because an -ExternalEmailAddress applies to mail users who have external email addresses.

    A is not the answer because you do not set the WindowsEmailAddress on a mailbox, you set the PrimarySMTPAddress

    Answer should be A!




    0



    0
      1. yesman323 says:

        Im sorry I was incorrect.

        Set-Mailbox -PrimarySMTPAddress does not exist.

        The answer is actually A. The -WindowsEmailAddress sets the primary email address and retains the old as a secondary proxy, hence B.

        Answer is A.




        0



        0
  5. Tony says:

    The answer is D and heres why

    A. The WindowsEmailAddress property is not used by Exchange

    B. The PrimarySMTPAddress is only available for Exchange 2013 on-premise

    C. The ExternalEmailAddress parameter does not exist in the set-mailbox cmdlet

    D. The Set-Mailuser cmdlet is for Exchange 2013 on-line and the EmailAddresses parameter is used to specify the email alias of the mail user. It can be used to set any type of address and may be used for multiple addresses by comma delimiting the values.

    This leaves D as the only possible answer, although I am not sure the syntax is correct




    0



    1
    1. Irish Ringer says:

      Except D: removes the current email address and the question states that it should remain in place as the secondary address.

      A is correct. Validated by myself and at least two others in this post.




      1



      0
      1. Aussie says:

        100% A is the answer read here http://o365info.com/manage-email-address-using-powershell/

        “Method 2#2 – Adding (replacing) primary E-mail address | Set the property – WindowsEmailAddress

        This is the preferred method because, when using this method, the additional E-mail address of the Exchange Online recipient will not be removed.
        In this method, we “address” other Exchange Online mailbox property named – WindowsEmailAddress.

        The Exchange Online mailbox property – WindowsEmailAddress, “contain” the recipient Primary E-mail address.

        In case that we set the value of the E-mail address stored in the WindowsEmailAddress property, the Exchange Online Recipient Primary E-mail address is also updated.”




        0



        0
  6. dirk says:

    It is definitly answer A, i’ve also tested it!

    I did:
    Get-Mailbox -Identity jmuller@domain.com | Select-Object emailaddresses

    EmailAddresses
    ————–
    {smtp:jmuller@domain.onmicrosoft.com, SMTP:jmuller@domain.com…

    As you can see, jmuller@domain.com is the primary Address.

    After I do

    Set-Mailbox -Identity jmuller@domain.com -WindowsEmailAddress jmuller@domain.onmicrosoft.com

    and did again the Get-Mailbox cmdlet, I end up in the following:

    EmailAddresses
    ————–
    {smtp:jmuller@domain.com, SMTP:jmuller@domain.onmicrosoft.com,

    So it changes the SMTP Prefixes of both
    This is what we wanted.




    0



    0
  7. J says:

    I agree with Dirk A is the correct answer. Tested it as well with additional aliases to the onmicrosoft domain as that one might be treated special. I.e. I don’t think it can be removed.
    The -WindowsEmailAddress makes the new address the primary but retains the old primary as a secondary.




    0



    0
  8. Alejandro says:

    i cant be D because is there only a line to complete. WindowsEmailAddress is the answer, agree with dirk.

    PS C:\office365\Setupfiles> get-Mailbox -Identity admin | Select-Object -ExpandProperty EmailAddresses
    SMTP:admin@apgc.com.ar

    PS C:\office365\Setupfiles> set-mailbox -Identity $viejo -WindowsEmailAddress $nuevo

    PS C:\office365\Setupfiles> get-Mailbox -Identity admin | Select-Object -ExpandProperty EmailAddresses
    SMTP:admin@content.apgc.com.ar
    smtp:admin@apgc.com.ar

    PS C:\office365\Setupfiles> set-mailbox -Identity $viejo -WindowsEmailAddress $viejo

    PS C:\office365\Setupfiles> get-Mailbox -Identity admin | Select-Object -ExpandProperty EmailAddresses
    SMTP:admin@apgc.com.ar
    smtp:admin@content.apgc.com.ar




    0



    0
  9. szumigalski says:

    VMware Certified Advanced Professional 6 (Desktop and Mobility Deployment) – The industry-recognized VCAP6-DTM Deploy certification validates that you know how to deploy and optimize VMware Horizon 6 (with View) environments. It demonstrates that you have the knowledge and skills essential to leverage best practices to provide a scalable and dependable Business Mobility platform for your business. Some of the subjects involve: Configuring and managing Horizon View components, configuring cloud pod archituecture, configuring Group Policy settings related to Horizon View, Configuring and optimizing desktop images for Horizon View & Mirage, Configuring and managing App Volumes AppStacks, Configuring desktop pools, Configuring and deploying ThinApp packaged applications, Configuring VMWare Identity Manager, etc.Szumigalski.com was created by Sebastian to spread his enthusiasm for PowerShell & VMWare. Sebastian is an IT qualified professional employed in Singapore for longer than 15 years who’s all of the time searching for innovative expertise to sharpen his technical abilities & knowledge. Since then, Sebastian has joined PowerShell User Group & VMWare VMug group, and has also been getting involved in most of the gatherings held in Singapore. This website will highlight exactly how Sebastian are able to automate some of his day-to-day tasks using PowerShell. You will find study guides available for the VCAP6-DTM examination, which are professionally compiled by Sebastian. Sebastian is certified with VCAP6-DTM, and is skilled with virtualization & server maintenance from four years experience in automation. The need for VMWare prepared admins and technicians are ever-increasing in the modern tech marketplace. Become familiar with more details on PowerShell & VMWare at Szumigalski.com!

    https://szumigalski.com




    0



    0
  10. Amr Eid says:

    The following is the provided answers to choose from:

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

    B. Set-Mailbox-Identity$UserPrincipalName-EmailAddresses@{add=”SMTP:”+”$NewPrimary”,”smtp:”+ “$OldPrimary”; remove=”SMTP:” + “$OldPrimary”}

    C. Set-Mailbox -Identity $UserPrincipalName -EmailAddresses @{add=”SMTP:” + “$NewPrimary”}

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




    0



    0

Leave a Reply