Solved

Auto-Disable inactive Active directory computers

Posted on 2014-03-13
5
440 Views
Last Modified: 2014-03-31
Hi All,

we are an R &D company. we reinstall ( domain join ) computers frequently.
let's say we reinstall and domain join (using different names ) at least 20 machine in a month.
old machines list is growing every month and we have to delete those manually, which is painful.

 
is there any way to tell AD to remove/delete inactive domain joined machines after some days by doing it's own checks !!!



Thanks,
Rafi
0
Comment
Question by:IMGIDC
  • 2
5 Comments
 
LVL 56

Expert Comment

by:Cliff Galiher
Comment Utility
There is no built-in functionality for this. You could write a PowerShell script and run it as a scheduled task. Or if you have automation software in place (many larger networks do) like System Center, you may be able to do so through that software. A system center runbook, for example.

But by script or by software, it'd be a highly customized solution and not very portable, so you won't likely find a canned script or software package.
0
 
LVL 56

Expert Comment

by:Cliff Galiher
Comment Utility
Which, to be clear, I did mention 3rd party automation software. It'd be impossible to list all 3rd party tools. There are plenty, some good, some bad, across a spectrum of price points.
0
 
LVL 35

Accepted Solution

by:
Mahesh earned 500 total points
Comment Utility
Use dsquery to find out inactive computers and pass its output to disable command as below

dsquery computer -inactive 5 -limit 0 -o rdn > C:\inactiveComputers.txt

The above command will list all inactive computers who have not logged since last 5 weeks

Now you can pipe this output to dsmod command to disable those accounts

dsquery computer -inactive 5 | dsmod computer -disabled yes

Above command will disable all inactive computers since 5 weeks
You can create schedule task on PDC server and run it every month once

Mahesh
0
 
LVL 2

Author Comment

by:IMGIDC
Comment Utility
Thanks Mahesh.

that's really impressive.
0

Featured Post

Free book by J.Peter Bruzzese, Microsoft MVP

Are you using Office 365? Trying to set up email signatures but you’re struggling with transport rules and connectors? Let renowned Microsoft MVP J.Peter Bruzzese show you how in this exclusive e-book on Office 365 email signatures. Better yet, it’s free!

Join & Write a Comment

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

763 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

11 Experts available now in Live!

Get 1:1 Help Now