Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Auto-Disable inactive Active directory computers

Posted on 2014-03-13
5
Medium Priority
?
458 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 59

Expert Comment

by:Cliff Galiher
ID: 39928450
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 59

Expert Comment

by:Cliff Galiher
ID: 39928513
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 38

Accepted Solution

by:
Mahesh earned 2000 total points
ID: 39928547
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
ID: 39928649
Thanks Mahesh.

that's really impressive.
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

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

Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
Transferring FSMO roles is done when an admin wants to split roles between certain Domain Controllers or the Domain Controller holding the Roles has been forcefully demoted using dcpromo / forceremoval
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

886 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