• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Removing old AD computers

I have a lot of old machines on our AD that I need to clean it up. How to I do so .
  • 2
1 Solution
Seth SimmonsSr. Systems AdministratorCommented:
From a domain controller...

dsquery computer -inactive x

replace x with number of weeks since being inactive

dsquery computer -inactive 52

displays computer accounts inactive more than 1 year

if you want to automatically remove those accounts...

dsquery computer -inactive 52 | dsrm
I like using oldcmd from joeware.net it can also give you a nice report before you want to delete any computers.

"oldcmd" should be oldcmp
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now