danne_sweden
asked on
How to find computer accounts that haven´t "logged in" for 3 months?
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks webmar and Samurai.
I did it using DSQuery ..
Danne_sweden
I did it using DSQuery ..
Danne_sweden
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"
Mem = Computer.ADSPath
Secs = Computer.Get("PasswordAge"
PWAge = Secs / 86400 '86400 Seconds per Day
wscript.echo Mem & " " & Int(PWAge)
End If
Next