Archive

Archive for July, 2009

Find inactive computers in Active Directory

July 14th, 2009 View Comments

This has been a particularly troublesome problem today, and I thought I’d help others out by sharing the fix that I found.

Active Directory can easily get littered with unused computers in large organizations, and before today, I didn’t know how to find and remove them.

On computers with the Server 2003 Support Tools installed, you can use dsquery to find inactive computers. For example to find computers that have been inactive for 13 weeks, you can use “dsquery computer -inactive 13 -limit 0″

That list can be used to automatically delete them from AD using “dsquery computer -inactive 13 -limit 0 | dsrm”