Page 1 of 2 12>
Topic Options
#58531 - 2001-08-24 05:23 PM Log dhcp leases using kixtart
Anonymous
Unregistered


I looked on microsoft knowledge base but didn't find any. Is there a way to log dhcp leases and put it on a separate files/directory? I would also like to have the date and time logged. I know you can use the @wksta @date, etc. on kix on this...I wonder how... If its not possible on kix, possibly resource kits? Thanks for the advice. -jvd

[ 24 August 2001: Message edited by: jvd626 ]

Top
#58532 - 2001-08-24 05:47 PM Re: Log dhcp leases using kixtart
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
jvd626 -
Yes.

Under Win2K, check key HKLM\CCS\Services\{NIC CARD ID}\Parameters\Tcpip, DHCPIPAddress

Under WinNT check key HKLM\CCS\Services\{Nic Card}\Parameters\Tcpip, DHCPIPAddress

You'll have to investigate further for Win9x.

Bill

Top
#58533 - 2001-08-24 05:57 PM Re: Log dhcp leases using kixtart
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
are you wanting to pull the lease information from the client via the logon script?

Or are you wanting to query the DHCP server for all DHCP lease information?

Bryce

Top
#58534 - 2001-08-24 08:05 PM Re: Log dhcp leases using kixtart
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Probably about the best your going to do with KiXtart is to write a log file every logon which has the date and current IP and MAC address. Since KiXtart only runs when a user logs in, it is not a live dynamic solution.

Since machines can renew their IP address inbetween logons, there is no "live" way for KiXtart to get that information for you.

You might be able to query/read the Microsft database that stores this information, but then again you might corrupt it trying to read it in a live situation using remote methods.

Top
#58535 - 2001-08-24 08:18 PM Re: Log dhcp leases using kixtart
Anonymous
Unregistered


Bryce, it doesn't matter which way I guess, as long as we know who has what. I think NTDOCs point makes sense, unless you can query the dhcp database somehow.

How about if people try to renew their lease, say, when they type ipconfig /release ipconfig /renew? That couldn't be logged because the user is already logged in.

Top
#58536 - 2001-08-24 08:33 PM Re: Log dhcp leases using kixtart
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
well if all you want is a list of current DHCP leases....

use the NTresource kit tool DHCPCMD.EXE

dhcpcmd <dhcpserver> enumclients <subnet>

Bryce

Top
#58537 - 2001-08-24 11:11 PM Re: Log dhcp leases using kixtart
Jeroen Offline
Starting to like KiXtart

Registered: 2001-08-16
Posts: 180
Loc: Netherlands
Another option (skipping the part about users using the /Renew and /Release options etc, since that's (I think) an unlikely event) is to use a program like Delayer.exe. Is can be run from commandline (login script) and can be used to execute a script after for instance 45 seconds or so. It has an option to be hidden from the user, so this might be an idea? This way, if the IP address is changed during logon, you'll get the IP address that's really being used... I don't have a URL for you, but if you can't find it, I can mail it to you if you like.
_________________________
Regards, Jeroen. There are two ways to write error-free programs. Only the third one works.

Top
#58538 - 2001-08-26 03:33 PM Re: Log dhcp leases using kixtart
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
bryce's info dhcpcmd.exe is good. I've used that little thingie and it defenetely shows correct info. it shows info when there are users that do not lock of their machines for months (like in our company) and thus can't be queried trhough logon script.
it also shows current info on machines that are offline (which can't retrieved by remote registry call's). and still it can show info on reserved ip's that belong to examp. printers. or win9x machines that can't be accessed remotely.
well, this is enough commercial allready, but with this tool you get directly current situation and directly in log format.
_________________________
!

download KiXnet

Top
#58539 - 2001-08-26 04:20 PM Re: Log dhcp leases using kixtart
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I'm happy you found a utility to give you this information but...
What value is there in knowing the lease info? I mean, it takes care of itself. I can think of no use for this information. Am I missing out on something?

Had to ask...

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#58540 - 2001-08-27 09:11 AM Re: Log dhcp leases using kixtart
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
Knowledge is Power

I heard that somewhere before

Top
#58541 - 2001-08-27 09:25 PM Re: Log dhcp leases using kixtart
Anonymous
Unregistered


LL, my boss wanted it so the leasing can be tracked down. I tried the dhcpcmd command but I'm not sure what its supposed to do. It just said:
quote:

DHCP server 5.5
Command Successfully completed.

Is there anything else that needs to be done? What type of output does it give out? Thanks.

[ 27 August 2001: Message edited by: jvd626 ]

Top
#58542 - 2001-08-27 09:55 PM Re: Log dhcp leases using kixtart
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
One of those bright ideas eh! Well, I figure you may have messed on one of the parameters. I tried:
DHCPCMD.EXE 10.198.10.1 enumclients 10.198.0.0
on my LAN and it works. THe first IP is the address of my DHCP server and the second is my subnet.

I still question the value of this info. When I want info on DHCP, I just run DHCPADMN.EXE on my WS. Still, it doesn't pay to argue with the guy that signs your paycheck.

quote:

DHCP Server version 4.1
1 10.198.50.1 999-51-197 09/06/2001 15:08:23
2 10.198.50.2 999-51-525 09/07/2001 10:02:53
3 10.198.50.3 ENI_SUPT 09/10/2001 07:34:14
4 10.198.50.5 999-51-554 09/10/2001 07:08:15
5 10.198.50.6 999-51-526 09/07/2001 08:06:34
6 10.198.50.8 999-51-555 09/10/2001 06:47:13
7 10.198.50.9 999-51-558 08/28/2001 08:39:05
8 10.198.50.12 FFENERGYSUPT 09/08/2001 11:41:24
9 10.198.50.13 999-51-407 09/10/2001 12:54:23
10 10.198.50.14 999-51-114 09/04/2001 08:01:43

[ 27 August 2001: Message edited by: LLigetfa ]

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#58543 - 2001-08-27 10:18 PM Re: Log dhcp leases using kixtart
Anonymous
Unregistered


Alright it works I guess its just stupidity in my part. But how can I export the data on to a text file?
Top
#58544 - 2001-08-27 10:51 PM Re: Log dhcp leases using kixtart
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
JVD,
You need to use the DOS redirect > to the file of your choosing (hence the %comspec%).
code:

break on
GO C:
SHELL '%comspec% /c "C:\DHCPCMD.EXE" 10.198.10.1 enumclients 10.198.0.0 > C:\dhcp.txt'
get $


Don't forget the single quote / double quote thingy if long names used.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#58545 - 2001-08-28 12:47 AM Re: Log dhcp leases using kixtart
Anonymous
Unregistered


cool, That worked, but I have another gripe How come it overrights the file instead of appending to it? Is there away so that it will append the file?
Top
#58546 - 2001-08-28 03:14 AM Re: Log dhcp leases using kixtart
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
> creates
>> appends


Top
#58547 - 2001-08-28 07:18 AM Re: Log dhcp leases using kixtart
Anonymous
Unregistered


sorry if my english is not good , well, what I mean is add stuff to the file instead of overwriting what It already has. Just like what an event viewer would do?
Top
#58548 - 2001-08-28 10:03 AM Re: Log dhcp leases using kixtart
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
I'm sorry JVD,

The single > (redirect symbol) creates the file.

The double >> (redirect symbol) appends to the file.

SAMPLE:
D:\>type fileone.txt
hello

D:\>echo hello again>>fileone.tx

D:\>type fileone.txt
hello
hello again

D:\>


I hope this makes more since now.

Top
#58549 - 2001-08-28 03:50 PM Re: Log dhcp leases using kixtart
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
BTW, it need not be a two-step process. >> will also create if not exist.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#58550 - 2001-08-28 07:47 PM Re: Log dhcp leases using kixtart
Anonymous
Unregistered


hehe I thought you're trying to correct my grammar... Thanks for the help!
Top
Page 1 of 2 12>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 496 anonymous users online.
Newest Members
Raoul, Timothy, Jojo67, MaikSimon, kvn317
17875 Registered Users

Generated in 0.081 seconds in which 0.048 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org