In
Charley said:
Does anyone know of a script of some sort that will
identify inactive computers in the AD?
Thanks
This question comes up about once or twice a week. If you just searched
back...
Here's a repost from a post from a few days ago:
============================================
----- Original Message -----
From: Craig Landis [MSFT]
Newsgroups: microsoft.public.win2000.active_directory
Sent: Tuesday, March 09, 2004 5:11 PM
Subject: RE: "Dead" Machine Accounts
Also, here is a script that can help with this -
'Script will output the machine account that have not changed
'its machine account password in the last 180 days.
'You can reduce this number by changing 15552000 which is
'86400(number seconds in the day) * 180(days). Every machine changes
'its machine account every 7 days for NT4 and 30 days for W2K
'Execute the script using cscript scriptname
Dim Container
Dim TargetDomain
Dim Member
Dim Computer
Dim fso
Dim tf
Set fso = createobject("Scripting.FileSystemObject")
Set tf = fso.createtextfile("C:\oldaccts.txt",TRUE)
TargetDomain = "Net Bios Name" 'Change this to the netbios name of the
domain
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") > 1 Then '15552000 is 180
days=(15552000(seconds)\86400(Seconds in 24hrs)
tf.WriteLine Computer.ADsPath & " " & (Computer.Get("PasswordAge")\86400) &
"Days Old"
End If
Next
Craig Landis [MSFT]
(e-mail address removed)
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
============================================
--
Regards,
Ace
Please direct all replies to the newsgroup so all can benefit.
This posting is provided "AS IS" with no warranties.
Ace Fekay, MCSE 2000, MCSE+I, MCSA, MCT, MVP
Microsoft Windows MVP - Active Directory