Solved

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

Posted on 2004-08-26
3
672 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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.…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now