?
Solved

Old computer accounts in windows 2008 active directory

Posted on 2013-01-15
6
Medium Priority
?
422 Views
Last Modified: 2013-01-15
I need a script to find and disable computer accounts which are 90 days of no activity in active directory
0
Comment
Question by:mahmoud_2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 19

Expert Comment

by:helpfinder
ID: 38779899
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
 
LVL 1

Author Comment

by:mahmoud_2008
ID: 38781480
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
 
LVL 19

Expert Comment

by:helpfinder
ID: 38781496
does not work just select all computers in your desired OU (ctrl+a) and right click where Disable account should be possible?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:mahmoud_2008
ID: 38781542
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
 
LVL 19

Accepted Solution

by:
helpfinder earned 2000 total points
ID: 38781551
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
 
LVL 1

Author Closing Comment

by:mahmoud_2008
ID: 38781575
Thanks a lot for your help
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question