Solved

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

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

929 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

9 Experts available now in Live!

Get 1:1 Help Now