Solved

Old computer accounts in windows 2008 active directory

Posted on 2013-01-15
6
416 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
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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 500 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Redirected folders in a windows domain can be quite useful for a number of reasons, one of them being that with redirected application data, you can give users more seamless experience when logging into different workstations.  For example, if a use…
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now