Solved

How to find computer accounts that haven´t "logged in" for 3 months?

Posted on 2004-08-26
3
717 Views
Last Modified: 2012-05-05
Hi experts

A simple (?) question for you.
Is there a way to select computer inactive computer accounts i a 2003 based AD.
I need to clean up computer accounts that has not been accessing the AD for a while.

Thank you all!
/Danne_sweden
0
Comment
Question by:danne_sweden
[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
3 Comments
 
LVL 1

Expert Comment

by:webmar45
ID: 11900396
hi here's a script i use,
you need to look for the password adge property, computers change their password every 30 days, so when the password age is 120 day's you know thats this is an old computer,
to delete computers, your the output and delete them manually
martin


Dim Container
Dim TargetDomain
Dim Member
Dim Computer
TargetDomain = "yourdomain"
Set Container = GetObject("WinNT://" & TargetDomain)
Container.Filter = Array("Computer")
For Each Member In Container
     Set Computer = GetObject("WinNT://" & TargetDomain & "/" & Member.Name
& "$,user")
     If Computer.Get("PasswordAge") > 5184000 Then      '60 Days
       Mem = Computer.ADSPath
       Secs = Computer.Get("PasswordAge")
         PWAge = Secs / 86400            '86400 Seconds per Day
    wscript.echo Mem & " " & Int(PWAge)
    End If
Next
0
 
LVL 9

Accepted Solution

by:
SamuraiCrow earned 500 total points
ID: 11900486
Use DSQuery to make these changes:

http://www.microsoft.com/windowsxp/home/using/productdoc/en/default.asp?url=/windowsxp/home/using/productdoc/en/dsquery.asp

This tool is built into 2003.  You can run simple queries from the command line and then pipe them into DSMod command:

http://www.microsoft.com/windowsxp/home/using/productdoc/en/default.asp?url=/windowsxp/home/using/productdoc/en/dsmod.asp

Below is an example of disabling all domain computer that haven't been on the network for 25 weeks:

dsquery computer -inactive 25|dsmod computer -disabled yes

Check out the links for more info on the DS family of commands here:

http://www.microsoft.com/windowsxp/home/using/productdoc/en/default.asp?url=/windowsxp/home/using/productdoc/en/ds_command_line_tools.asp

Good luck, I hope this helps
Crow
0
 

Author Comment

by:danne_sweden
ID: 11901385
Thanks webmar and Samurai.

I did it using DSQuery ..

Danne_sweden
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
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…

749 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