Friday, August 29, 2014

Active Directory Powershell Function - Get-UserLockout

The function below is used for looking up the Locked out status of an Active Directory User. Usage is:

Get-UserLockout username

Active Directory Powershell Module required.
 

function Get-UserLockout
{
 
Param(

[Parameter(Mandatory=$True,Position=1)]

[string]$Username
)
 
 
Get-ADUser $Username -Properties * | Select Lockedout }


Rich