How can I verify if an AD account is locked?
Here's another one:
PS> Search-ADAccount -Locked | Select Name, LockedOut, LastLogonDate
Name LockedOut LastLogonDate
---- --------- -------------
Yxxxxxxx True 14/11/2014 10:19:20
Bxxxxxxx True 18/11/2014 08:38:34
Administrator True 03/11/2014 20:32:05
Other parameters worth mentioning:
Search-ADAccount -AccountExpired
Search-ADAccount -AccountDisabled
Search-ADAccount -AccountInactive
Get-Help Search-ADAccount -ShowWindow
The LockedOut
property is what you are looking for among all the properties you returned. You are only seeing incomplete output in TechNet. The information is still there. You can isolate that one property using Select-Object
Get-ADUser matt -Properties * | Select-Object LockedOut
LockedOut
---------
False
The link you referenced doesn't contain this information which is obviously misleading. Test the command with your own account and you will see much more information.
Note: Try to avoid -Properties *
. While it is great for simple testing it can make queries, especially ones with multiple accounts, unnecessarily slow. So, in this case, since you only need lockedout
:
Get-ADUser matt -Properties LockedOut | Select-Object LockedOut