+ Post New Thread
Results 1 to 3 of 3
Windows Server 2000/2003 Thread, Keeping track of workstation IP address history in Technical; My network has two Win 2003 servers each running a DHCP service. This means that when a lease expires it ...
  1. #1

    Join Date
    Mar 2007
    Posts
    12
    Thank Post
    7
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Keeping track of workstation IP address history

    My network has two Win 2003 servers each running a DHCP service. This means that when a lease expires it can be a race to to find the first available address from either server so machines frequently change IP address.

    I need to be able to keep track of the IP address history of each workstation on my network (300+ XP machines) for at least the previous 2 weeks. I know I can look up their present IP address in the DNS but I want a simple quick way to be able to check the IP a machine was using at any given time over the past fortnight.

    Bob

  2. #2

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,037
    Thank Post
    209
    Thanked 425 Times in 306 Posts
    Rep Power
    144
    This little script run as a startup script will log the current IP address of a workstation together with the date and time to a log file on the local C:\

    With a little bit of tweeking it can be modified to store it on a central server with machine names etc. in seperate log files for each day, or in seperate log files for each machine etc.

    It's very badly written, I knocked it up sometime ago from various examples of other scripts on the net for a specific purpose when I was doing some troubleshooting, but it works.

    Code:
    strcomputer = "."
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery _
        ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
    for each objitem in colitems
    strIPAddress = Join(objitem.IPAddress, ",")
    next
    
    IP = stripaddress
    
    strFile = "C:\IPaddressLog.txt"
    strText = date & " " & time & " " & IP
    
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    If objFSO.FileExists(strFile) Then
    Else
       Set objFile = objFSO.CreateTextFile(strFile)
    End If
    
    Const ForAppending = 8
    Set objTextFile = objFSO.OpenTextFile (strFile, ForAppending, True)
    objTextFile.WriteLine(strText)
    objTextFile.Close
    
    WScript.Quit

  3. Thanks to maniac from:

    Diatom (28th June 2010)

  4. #3

    GrumbleDook's Avatar
    Join Date
    Jul 2005
    Location
    Gosport, Hampshire
    Posts
    9,921
    Thank Post
    1,332
    Thanked 1,773 Times in 1,100 Posts
    Blog Entries
    19
    Rep Power
    593
    I would also strongly recommend you got to DHCP reservations. Since most schools will have sufficiently large an IP range that they don't need to use DHCP for anything other than passing out centralised config then DHCP reservations will solve your problem. That way you should never have to worry about the problem at all.

  5. Thanks to GrumbleDook from:

    Diatom (28th June 2010)

SHARE:
+ Post New Thread

Similar Threads

  1. Keeping track of all your knowlege
    By Robot in forum How do you do....it?
    Replies: 26
    Last Post: 4th December 2013, 10:38 AM
  2. Keeping track of Licensing
    By keogk in forum Licensing Questions
    Replies: 17
    Last Post: 15th February 2011, 11:49 AM
  3. Track Users IE History on a Domain
    By DriftGrant in forum How do you do....it?
    Replies: 12
    Last Post: 17th November 2010, 05:42 AM
  4. [News] Keeping It Cool
    By mattx in forum Jokes/Interweb Things
    Replies: 0
    Last Post: 6th November 2009, 09:46 PM
  5. audit of Users history login history
    By Scotmk in forum Wireless Networks
    Replies: 7
    Last Post: 31st January 2008, 05:50 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •