| |
durhamrobertl
Posts: 1
Score: 0
Joined: 6/29/2005
From:
Status: offline
|
This .vbs was working, then quit . I'm not sure how long ago it quit working, but the only thing I know has changed is SP's and going native. I wrote this for the server group to keep the old computer accounts cleaned up, so not sure if it was modified slightly and I'm not seeing it, or if being native now is the problem with the connection. I get an error on the Set Computer line for "The network path was not found". I can only guess that it no longer likes the netbios name for the domain we usually input, but WINS is still running and the entries are there. Originally, (prior to being native) I had trouble getting connected via RootDSE, so did this instead. Any help would be appreciated... Dim Container Dim Member Dim Computer Dim AgeInDays Dim AgeInSeconds dim strDomName dim strFileName Counter = 0 strMsgDom="Please enter the Domain you wish to view: " strDomName=Inputbox(strMsgDom,"Enter Domain Name") strMsgFile="Please modify the location and the text file name that you want: " strFilename=Inputbox(strMsgFile,"Folder and File Name","C:\Temp\OldMacAc.txt") set fso=CreateObject("Scripting.FileSystemObject") set fil=fso.CreateTextFile(strFileName) fil.WriteLine strDomName & " Old Machine Accounts and number of days since last used" fil.WriteLine "" Set Container = GetObject("WinNT://" & strDomName) Container.Filter = Array("Computer") For Each Member In Container Set Computer = GetObject("WinNT://" & strDomName & "/" & "Computer.Name" & ",computer") AgeInSeconds = Computer.Get("PasswordAge") AgeInDays = Cint(((AgeInSeconds/60)/60)/24) If AgeInSeconds > 15552000 Then fil.WriteLine(Computer.Name & " " & AgeInDays) Counter = Counter + 1 End If Next Wscript.Echo Counter & " machine accounts are old" set fop=CreateObject("WScript.Shell") fop.run "%windir%\Notepad.exe C:\Temp\OldMacAc.txt"
|
|