Useraccountcontrol Flag can help user to check if account is enabled or Disbaled. Please find the below mentioned script to find the same. If Useraccountcontrol value is 512 then its normal account if its 514 then account is disabled. You can find some information the UseraccoutControlflag http://support.microsoft.com/kb/305144
$UserName = “UserName”
$searcher = new-object DirectoryServices.DirectorySearcher([ADSI]””)
$searcher.filter = “(&(objectClass=user)(sAMAccountName= $UserName))”
$founduser = $searcher.findOne()
$founduser.Properties.useraccountcontrol
$value = $founduser.Properties.useraccountcontrol
if ($Value -eq 514)
{
Write-Output “Account is disabled”
}
if ($Value -eq 512)
{
Write-Output “Account is Enabled”
}