PrepAway - Latest Free Exam Questions & Answers

How should you complete the relevant Windows PowerShell…

HOTSPOT
A company has an Office 365 tenant. You install the Microsoft Azure Active Directory module for Windows
PowerShell.
An employee leaves the company. The employee’s account is named user1@contoso.com.
You need to hard delete the user’s account.
How should you complete the relevant Windows PowerShell commands? To answer, select the appropriate
Windows PowerShell segments from each list in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:
https://docs.microsoft.com/en-us/powershell/module/msonline/remove-msoluser?view=azureadps-
1.0

12 Comments on “How should you complete the relevant Windows PowerShell…

  1. O365 says:

    https://docs.microsoft.com/en-us/powershell/module/msonline/remove-msoluser?view=azureadps-1.0

    Remove a user from the Recycle Bin PowerShell

    Remove-MsolUser -UserPrincipalName “davidchew@contoso.com” -RemoveFromRecycleBin
    The previous command removes the user “From the Recycle Bin”, meaning that it needs to already be deleted.
    So the correct answer should be:
    Remove-MsolUser -userprincipalname user1@contoso.com -Force
    Remove-MsolUser -userprincipalname user1@contoso.com -RemoveFromRecycleBin
    First command soft deletes the user
    Second command hard deletes the user
    You can’t combine both because the second command looks for the user in the Recycle Bin




    1



    0
  2. chris says:

    RemoveFromRecycleBin
    Indicates that this cmdlet permanently removes a deleted user from the recycle bin. This operation which can be applied only to deleted users. When this operation has been completed, you will not be able to recover the user by using the Restore-MsolUser cmdlet.

    Can only be used when user is allready soft deleted so it is the -force




    0



    0
  3. mischa69 says:

    Hard deleting a user is a 2-step process

    1. Soft delete: (you can also delete the user in the GUI)
    Remove-MsolUser -userprincipalname user1@contoso.com -Force

    2. Hard delete (only powershell)
    Remove-MsolUser -userprincipalname user1@contoso.com -RemoveFromRecycleBin

    So it says nothing in the question that the user is already soft deleted.

    So I would say the correct answer is:

    Remove-MsolUser -userprincipalname user1@contoso.com -Force




    0



    0

Leave a Reply