[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2004-08-26
3
Medium Priority
?
777 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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.…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

650 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