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
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
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.Fi leSystemOb ject")
Set objCompFile = objFSO.OpenTextFile(strCom pFile, ForWriting, TRUE)
Set objDCFile = objFSO.OpenTextFile(strDCF ile, 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********************* **
****************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.Fi
Set objCompFile = objFSO.OpenTextFile(strCom
Set objDCFile = objFSO.OpenTextFile(strDCF
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
objCompFile.Writeline objNTComp.Name & "-- computer account has been deleted"
End If
End If
Next
*******************END COPY AND PASTE*********************
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?
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.