Solved

Auto-Disable inactive Active directory computers

Posted on 2014-03-13
5
447 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
[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
  • 2
5 Comments
 
LVL 58

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 58

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 37

Accepted Solution

by:
Mahesh earned 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 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