PrepAway - Latest Free Exam Questions & Answers

Which cmdlet should you run?

HOTSPOT
You have an Office 365 subscription.
The Office 365 organization contains five temporary administrators. The administrators are members of
multiple role groups.
You need to create a script that prevents the temporary administrators from performing administrative tasks
from the Office 365 admin center. The solution must meet the following requirements:
Provide the ability to reestablish administrative access to the temporary administrators within 14 days.
Release the Office 365 licenses assigned to the temporary administrators.
Which cmdlet should you run? To answer, select the appropriate options in the answer area.
Hot Area:

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:
The Set-MsolUserLicense cmdlet can be used to adjust the licenses for a user. This can include adding a new
license, removing a license, updating the license options, or any combination of these actions.
Example:
The following command removes the for enterprises license from the user. This may result in the user’s data
being removed from each service.
Set-MsolUserLicense -UserPrincipalName user@contoso.com -RemoveLicenses
“contoso:ENTERPRISEPACK”
https://msdn.microsoft.com/en-us/library/azure/dn194094(v=azure.98).aspx

11 Comments on “Which cmdlet should you run?

    1. frank says:

      Agree with Chris. the command should be:
      Remove-msoluser and -RemoveLicenses
      After removing a user, you have 14 days to recover/restore it.
      Not sure if the -RemoveLicenses need to be specified when removing a user.




      0



      0
      1. Dennis says:

        Nowhere does it state though that the users(-accounts) have to be removed though. Only that administrative privileges should be removed for the time being. Remove-msoluser is not the way to go I imagine.




        0



        0
  1. J says:

    I have tested this
    Created a new user and assigned it a license
    Ran remove-msoluser -force
    This has put the user into the recycle bin and given back the license.

    The key points are that the license needs to be given back which this does
    The accounts will only be inactive for 14 days so you can recover the account from the recycle bin easily, during the 14 days the admins won’t be able to login which meets the other requirement.

    Running remove-msoluserlicense won’t stop the administrators from logging in as others have pointed out.




    0



    0
  2. leonardo says:

    Set-msoluser -userprincipalname user1,… -BlockCredentials $true and then Set-msoluser -userprincipalname user1,… -BlockCredentials $false after 14 days. this is a clean way. Remove-user is a valid action but its depends on recycle bin 30 days limit to restore user account. If you just block it, recover account isn’t required




    0



    0
  3. Amr Eid says:

    Set-msolUser cmdlet is NOT correct one because, this command sets block credential to $True for a user, which blocks them from being able to sign in. However, this cannot be done for a synced user 1, so it does not apply to our case.




    0



    0

Leave a Reply