Everyone makes mistakes. Sometimes end users forget their passwords and lock themselves out of their Active Directory access. Administrators can unlock these accounts via the Windows GUI, but what if there was a quicker way. The PowerShell Active Directory module can save administrators time in governing end users and can also provide automation if required. This example will highlight how to unlock an end user account in minimal steps via PowerShell and the Active Directory module. Let's get started.
Install-Module ActiveDirectory
Or confirm the module is loaded using the following command:
Get-Module ActiveDirectory
Get-ADUser -Identity 'ENTER USER NAME HERE' -Properties LockedOut | Select-Object Name,Lockedout
Unlock-ADAccount -Identity 'ENTER USER NAME HERE'
Get-ADUser -Identity 'ENTER USER NAME HERE' -Properties LockedOut | Select-Object Name,Lockedout
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.