Disabling a user
When a user's access needs to be temporarily disabled so that the user cannot access Office 365 with those credentials but the data and user setup are not lost, an admin does not need to completely remove or unlicense a user. Instead, simply blocking the user's credentials will suffice. Let's disable a user in this recipe.
Getting ready
Using the skills learned in the Setting up the PowerShell environment recipe from Chapter 1, Office 365 Setup and Basic Administration, connect to your Office 365 tenant via PowerShell.
How to do it…
Update the UserPrincipalName
parameter to the appropriate user, and then run the following code snippet:
Set-MsolUser -UserPrincipalName testingMayDeleteLater@natechamberlain.com -BlockCredential $true
How it works…
You've just disabled a user in a single step. The BlockCredential
property on a user's profile will stop a user from being able to gain access with the blocked credentials...