?
Solved

Auto-Disable inactive Active directory computers

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

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
Active Directory can easily get cluttered with unused service, user and computer accounts. In this article, I will show you the way I like to implement ADCleanup..
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses

752 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