I have the following script that will give me all computer accounts that
have not had a password changed in a number of days, how can i get it so the
script can write this to a text file for editing...
Thanks
Gavin...
On Error Resume Next
DomainString=InputBox("Enter the domain name","Check Active
Computers","DomainName")
If DomainString="" Then
WScript.echo "No domain specified or script cancelled."
WScript.quit
End If
numDays=InputBox("What is the number of days to use as a cutoff for Active
Computer Accounts?","Check Active Computers","XX")
If numDays="" Then
WScript.echo "No cutoff date specified or script cancelled."
WScript.quit
End If
Set DomainObj = GetObject("WinNT://"&DomainString)
If err.number<>0 Then
WScript.echo "Error connecting to " & DomainString
WScript.quit
End If
DomainObj.Filter = Array("computer")
WScript.echo "Computer Accounts in " & DomainString & " older than " &
numDays & " days."
For Each Computer In DomainObj
Set Account = GetObject("WinNT://" & DomainString & "/" & Computer.Name &
"$")
RefreshTime = FormatNumber((Account.get("PasswordAge"))/86400,0)
If CInt(RefreshTime) >= CInt(numDays) Then
WScript.echo "**DELETE** " & Computer.Name & " Password Age is " &
RefreshTime & " days."
End If
Next
Set DomainObj=Nothing
Set Shell=Nothing
WScript.quit