How can I purge old unused 'Computer' entries from Active Directory? Mostly machines that have been retired or renamed. Status Solved. First use 'dsquery computer -inactive 8 -limit 0' to find such computers. I am trying to REMOVE all computers that have not logged on within the last 2-3 months. The_Geppetto Commented: 2011-01-27.
Active8 years, 3 months ago
Possible Duplicate: Removing old computers on a domain
Users And Computers Active Directory
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?
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.
2 Answers
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.
Remove Inactive Computer Accounts Active Directory
SpacemanSpiffSpacemanSpiff
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.
There's also an article on the MS Scripting center about how to do it:
Edit: JScott's answer from a previous thread seems to be the best answer:
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.
2 Answers
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.
SpacemanSpiffSpacemanSpiff
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.
There's also an article on the MS Scripting center about how to do it:
Edit: JScott's answer from a previous thread seems to be the best answer: