PrepAway - Latest Free Exam Questions & Answers

How should you complete the relevant Windows PowerShell command?

DRAG DROP
You are the Office 365 administrator for your company. Your company uses Office 365 for
collaboration.
You must reset the password for all of the employees in your company.
You need to ensure that all employees create a new password the next time they sign in to Office
365.
How should you complete the relevant Windows PowerShell command? To answer, drag the
appropriate Windows PowerShell segment to the correct location or locations. Each Windows
PowerShell segment may be used once, more than once, or not at all. You may need to drag the split
bar between panes or scroll to view content.

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:

15 Comments on “How should you complete the relevant Windows PowerShell command?

  1. FixyThis says:

    This answer is tricky in the wording (You need to reset all passwords for all users, AND force a password change on next login)

    By default ForcePasswordChange is set to $true, in order to bypass it in a script you have to change it to 0 or $false.

    Get-MSOLUser -ALL | Set-MSOLUserPassword -ForceChangePassword $true
    Would accomplish the 2nd part of the question, but not the first. Making the answer above the only one that is correct.

    http://msdn.microsoft.com/en-us/library/azure/dn194140.aspx




    0



    0
  2. Adriano says:

    In my opinion we have use -ForceChangePassword $True, because it will force end user change the their password, in theory we are reseting and changing in the same time and you use newpassword option, the end user will be necessary to know the new password but is not mandatory to change it..




    0



    0
  3. szymarek says:

    Get-MsolUser -all | Set-MsolUserPassword -NewPassword Pass#123#
    will change password for all user to Pass#123# and on next logon everbody must change password before use. So this anserwer is correct.

    Just finished test on my M$ account




    0



    0
  4. Frank says:

    See example 2 on this page:
    https://msdn.microsoft.com/en-us/library/azure/dn194140.aspx
    ***********
    Example 2
    This command resets the password for user@contoso.com. The user will be required to reset the password on next sign in.
    Set-MsolUserPassword -userPrincipalName user@consoso.com -NewPassword Nula8787
    ***********

    It is just a stupid question, but I think the answer is correct, and when creating a new passwd, they are by default required to change it on next logon. Only setting -ForceChangePassword $true, does not reset their password (only after they login and change it)

    What makes it stupid is that you would never want to do this in a real life situation, to reset all users password to the same…




    0



    0
  5. John says:

    I’d say it’s

    Get-MSOLUser -All | Set-MsolUserPassword -ForceChangePassword

    As other users have commented, the aim is to force them to change the password so that it’s reset. Forcing the user to change the password will ensure that the password is reset.

    Using -NewPassword will change everyone’s password to the same thing. This is bad from a security viewpoint and it won’t ask them to change the password when they next login.




    0



    0
    1. DM says:

      “and it won’t ask them to change the password when they next login.”

      Yes it will. As several people before have posted explicitly, with the relevant links.

      The question asks for two things: resetting the password for all users, and also forcing them to change their password on first logon.

      By default, forcing a password reset using powershell with a specific password set will change the password, AND force the user to change it on next logon.




      0



      0
  6. Bala says:

    From my testing:

    1. If you run the -ForceChangepassword $true it would reset and provide the new random password for all the users, its damn list everything you are not sure which is for which user :(.

    2 . If you run the -Newpassword with the common password for all the users, and pass the single password to all the users, once they login to the portal it would ask them reset the password by default. Verified from my end. So this would be ideal option.




    0



    0
  7. startbucks says:

    i agree -newpassword is much less effort than -forcechangepassword for the admin work.

    In -newpassword all users will use the same password to set new password
    while -forcechangepassword will generate random passwords for all users which is tedious work for admins. what if you have thousands of users?

    Thats why i preferred the -newpassword cmdlet




    0



    0

Leave a Reply