You have all the tools you need on your domain controller already. The main command you want to use is DSQUERY. To find objects that have been inactive for 52 weeks, open a CMD window and type :
DSQUERY computer -inactive 52
DSQUERY user -inactive 52
You can also search for stale passwords using the -stalepwd <num of days>
switch instead of -inactive
. You could also search for disabled accounts by using the -disabled
switch
If you want to take it to the next level, you can have it automatically move the objects into an OU of your choice (where you can then analyse what's there before you take any further action) by piping the results to the DSMOVE command like so:
DSQUERY computer -inactive 52 | DSMOVE -newparent <distinguished name of target OU>
Edit:
Here are all the builtin DS commands to experiment with:
dsadd /? - help for adding objects.
dsget /? - help for displaying objects.
dsmod /? - help for modifying objects.
dsmove /? - help for moving objects.
dsquery /? - help for finding objects matching search criteria.
dsrm /? - help for deleting objects.