Solved

NT4 Server Manager

Posted on 2004-03-20
5
502 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Have you ever set up your wireless router at home or in the office to find that you little pop-up bubble in the bottom right-hand corner of Windows read "IP Conflict - One of more computers on the network have been assigned the following IP address"…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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…

772 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