Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
Removing old computers on a domain

We've got a Windows Server 2008 instance (R1) and have several computers that are no longer present. Still, they show up in the AD.

Is there a way to purge old computers that have not been online for X months from the AD?

share|improve this question

marked as duplicate by jscott, Evan Anderson, Massimo, Holocryptic, Shane Madden May 13 '11 at 14:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

2 Answers

JoeWare has a script that will query for old computers. This works for 2000/2003, I'm not sure how nicely it will work on a 2008 Native domain, though.

http://www.joeware.net/freetools/tools/oldcmp/index.htm

There's also an article on the MS Scripting center about how to do it:

http://blogs.technet.com/b/heyscriptingguy/archive/2008/11/19/how-can-i-find-old-computer-accounts.aspx

Edit: JScott's answer from a previous thread seems to be the best answer:

dsquery computer -inactive 10 -limit 0

Where 10 is the number of weeks of inactivity

share|improve this answer
add comment

Check out PowerGUI from Quest, you can use it to run a search for workstation objects that have not been active in X number of days, and then delete them. Do be careful with the tool, it's very powerful.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.