How to find disabled/inactive accounts in Active Directory using powershell


Log in to your active directory server and start the active directory module for powershell then run the following command to get as list of users.

Replace DC with correct name

Disabled Accounts

Search-ADAccount -AccountDisabled -SearchBase “DC=YOURDCNAME,DC=int” | FT Name,LastLogonDate,ObjectClass –A

Inactive Accounts: (No logins recorded since some day)(Corrent Datetime)

Search-ADAccount -AccountInactive -Datetime 01/10/2014 -SearchBase “DC=redtech,DC=int” | FT Name,LastLogonDate,ObjectClass –A


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s