Solved

Sort computers by last logon in AD?

Posted on 2006-11-10
1
308 Views
Last Modified: 2009-07-14
Is there any way to filter computers by last logon?  I see an option similar to that for users, but that doesn't help.

I need to delete all the computers from active directory that are not current, without hand counting.  For example, if a computer has not logged into the domain for over two weeks, it should get purged.
0
Comment
Question by:menreeq
1 Comment
 
LVL 51

Accepted Solution

by:
Netman66 earned 500 total points
ID: 17919409
Two weeks is a little short - what happens with laptop users that are on the road?

If your domain is in Native mode, then this will tell you what computers are "stale" (haven't logged in in 4 weeks).

dsquery computer -inactive 4

To disable them at the same time:

dsquery computer -inactive 4 | dsmod computer -disabled yes



To move them after disabling them:

dsquery computer -inactive 4 | dsmod computer -disabled yes
dsquery computer -disabled | dsmove -newparent "OU=stale,DC=domain,DC=com"



0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 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