Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sort computers by last logon in AD?

Posted on 2006-11-10
1
Medium Priority
?
314 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
[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
1 Comment
 
LVL 51

Accepted Solution

by:
Netman66 earned 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

604 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