Link to home
Start Free TrialLog in
Avatar of m1ck99
m1ck99

asked on

NT4 Server Manager

Hi

Does anybody know a utility that will show me all inactive computers/servers in Server Manager (NT4 Server), along with the date which they last connected to the domain?  

Many thanks

Mick
Avatar of jcoppin
jcoppin
Flag of Canada image

i have a vb script if your interested, it will query the domain, dump a list of computers and then delete them from the domain if they haven't logged in in a given period of time.
create a textfile called dclist.txt in the same directory you are running the script from. add all your domain controllers to this file. change intAccountAge = 60 to suite your needs, i have found that any pc that hasn't logged in in 60 days  has generally been reimaged/reinstalled and given a new name. hope this helps


****************copy and paste below**********************
On error Resume Next
Const ForReading = 1
Const ForWriting = 2
Dim objFSO, objCompFile, objDCFile, objDomain, objComp, objNTComp
Dim strCompFile, strDCFile
Dim strDomain, strDCList
Dim intSecInADay, intAccountAge

strCompFile = "InactivePCs.txt"
strDCFile = "DCList.txt"
strDomain = inputbox("Enter Domain")

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objCompFile = objFSO.OpenTextFile(strCompFile, ForWriting, TRUE)
Set objDCFile = objFSO.OpenTextFile(strDCFile, ForReading)
Set objDomain = GetObject("WinNT://" & strDomain)
objDomain.Filter = Array("Computer")
strDCList = objDCFile.ReadAll()
intSecInADay = 60 * 60 * 24
intAccountAge = 60

For Each objComp In objDomain
    Set objNTComp = GetObject("WinNT://" & strDomain & "/" & objComp.Name & "$")
    If (objNTComp.PasswordAge > intSecInADay * intAccountAge) Then
        If InStr(1, strDCList, objComp.Name, vbTextCompare) = 0 Then
             Call objDomain.Delete("Computer", objComp.Name)
             objCompFile.Writeline objNTComp.Name & "-- computer account has been deleted"
        End If
    End If
Next

*******************END COPY AND PASTE***********************
Avatar of bbao
m1ck99, what's your definition of "inactive computers/servers"? do you mean those computers that ever logged on the network (appeared in the computer list of network neighborhood)? you want to know the date of their last logon?
Avatar of m1ck99
m1ck99

ASKER

Hi

dcoplin

Thanks to dcoplin for replying. I will try it inthe next few days

bbao

Yes, you are right , i want to  know the last date of their logon.

Thanks for replying

Mick
ASKER CERTIFIED SOLUTION
Avatar of jcoppin
jcoppin
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial