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
LVL 1
mahmoud_2008Asked:
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

http://gallery.technet.microsoft.com/scriptcenter/adaf5be6-b266-4263-8d09-cad20ce8d5ef
0
 
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
0
 
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
0
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?
0
 
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
0
 
mahmoud_2008Author Commented:
Thanks a lot for your help
0
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.