MicrosoftMicrosoft Office 365Powershell
How to Unlock a User Account in Office 365 Using PowerShell
Table of Contents
Table of Contents
User accounts in Office 365 (Microsoft 365) can become locked for various reasons, such as repeated incorrect password attempts. When this happens, administrators need a way to quickly and efficiently unlock those accounts. Using PowerShell is one of the most effective methods.
Add-WindowsFeature RSAT-AD-Powershell
).Connect-MsolService
Enter your Office 365 administrator credentials when prompted.
Get-ADUser -Identity 'username' -Properties LockedOut | Select-Object Name,Lockedout
Replace ‘username’ with the actual username. The output will show if the account is locked.
Unlock-ADAccount -Identity 'username'
Again, replace ‘username’ with the relevant account name.
For unlocking multiple locked out accounts, use these commands:
Search-ADAccount -Lockedout | Select-Object Name, SamAccountName
Search-ADAccount -LockedOut | Unlock-AdAccount
By mastering these PowerShell commands for Office 365, you’ll streamline your administrative tasks when dealing with locked user accounts. Remember, consistent SEO practices will help your article get noticed by users who need this information.