RE: "Dead" Machine Accounts
From: Craig Landis [MSFT] (clandis_at_online.microsoft.com)
Date: 03/09/04
- Next message: Seth Scruggs [MSFT]: "Re: Policies Not Applying"
- Previous message: Oli Restorick [MVP]: "Re: How do I hide subfolders?"
- In reply to: William P.: ""Dead" Machine Accounts"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 9 Mar 2004 14:11:05 -0800
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]
clandis@online.microsoft.com
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
- Next message: Seth Scruggs [MSFT]: "Re: Policies Not Applying"
- Previous message: Oli Restorick [MVP]: "Re: How do I hide subfolders?"
- In reply to: William P.: ""Dead" Machine Accounts"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|