Reply To: How To List Inactive Computer Accounts In Active Directory

IT Support Forum Forums Active Directory Users And Computers How To List Inactive Computer Accounts In Active Directory Reply To: How To List Inactive Computer Accounts In Active Directory

#48
Webmaster
Keymaster

There are a few ways you can list inactive (or stale) computer accounts in AD, such as via PowerShell or with a program like Hyena.

My favourite way to list inactive computer accounts is with dsquery. This is because you can pipe the output of a dsquery into another query or text file, which you can then use for something else.

To list computers that have been inactive in AD for 3 months (90 days), use the below dsquery command in a command prompt window on a domain controller or PC on the domain with RSAT tools installed:

dsquery computer -stalepwd 90 -limit 99999

If you want, you can pipe this out to a text file but adding > C:\FileName.txt to the end of the command.