Old computer accounts in windows 2008 active directory

I need a script to find and disable computer accounts which are 90 days of no activity in active directory
Who is Participating?
helpfinderConnect With a Mentor IT ConsultantCommented:
yes, should be possible.
I found also script on Technet which find inactive computers, disable them and move to separate OU

helpfinderIT ConsultantCommented:
For finding such a computers use this command:
dsquery computer –inactive 12 > c:\admin\computer90day.txt

and for disable this one should be working
    dsquery computer –inactive 12 | dsmod computer –disabled yes
mahmoud_2008Author Commented:
Thanks, I checked the first command and it works fine.
for the second command, is it possible to run it against a single OU?
if yes what is the command for that
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.

helpfinderIT ConsultantCommented:
does not work just select all computers in your desired OU (ctrl+a) and right click where Disable account should be possible?
mahmoud_2008Author Commented:
in this case can I move these computers (90 days inactive) to an OU named: disabled_computers, then I can do the above procedure
mahmoud_2008Author Commented:
Thanks a lot for your help
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.

All Courses

From novice to tech pro — start learning today.