Solved

NT4 Server Manager

Posted on 2004-03-20
5
504 Views
Last Modified: 2013-12-23
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
0
Comment
Question by:m1ck99
  • 3
5 Comments
 
LVL 4

Expert Comment

by:jcoppin
ID: 10645705
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.
0
 
LVL 4

Expert Comment

by:jcoppin
ID: 10645728
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***********************
0
 
LVL 37

Expert Comment

by:bbao
ID: 10675464
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?
0
 

Author Comment

by:m1ck99
ID: 10675644
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
0
 
LVL 4

Accepted Solution

by:
jcoppin earned 250 total points
ID: 10678015
This script will delete any computer account older than 60 days, that is 60 days without logging onto the network
to run it without deleting just change           Call objDomain.Delete("Computer", objComp.Name)  to 'Call objDomain.Delete("Computer", objComp.Name)


It will then generate a list of computers that will be deleted but will not delete them till you run it again and uncomment that line


 
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Massive network latency 1 66
Converting TV to Network (Muli-User) Web front. 8 74
Office 2016 Network Activation 2 34
SCCM firewall status and security group members 4 56
Sometimes you might need to configure routing based not only on destination IP address, but also on a combination of destination IP address (or hostname) and destination port number. I will describe a method how to accomplish this with free tools. …
Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question