From the command line:

dsquery computer –inactive 4 –limit 0

This will list all computer accounts that have not been active for 4 weeks.

 

Remove inactive computer accounts:

dsquery computer –inactive 4 –limit 0 | dsrm