Solved

Old computer accounts in windows 2008 active directory

Posted on 2013-01-15
6
414 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
The problems with reply email signatures

Do you wish that you could place an email signature under a reply? Well, unfortunately, you can't. That great Exchange/Office 365 signature you've created will just appear at the bottom of an email chain. What a pain! Is there really no way to solve this? Well, there might be...

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…

747 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

13 Experts available now in Live!

Get 1:1 Help Now