473,508 Members | 3,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query for current DHCP leases

Does anyone know if VB has an exposed API that can be used to query DHCP for
current address leases? I have seen threads that discuss DHCPObj.dll and
have successfully used it. However, this only exposed the server's
configuration, not the current address leases. I was also able to track
down an interface that is exposed to C, but 1.) already have a lengthy app
written in VB and 2.) don't know enough about C to write my own dll to do
this. Any ideas?
Nov 20 '05 #1
8 13696
In article <u1*************@TK2MSFTNGP11.phx.gbl>, ri*******@dyncfg.com
says...
Does anyone know if VB has an exposed API that can be used to query DHCP for
current address leases? I have seen threads that discuss DHCPObj.dll and
have successfully used it. However, this only exposed the server's
configuration, not the current address leases. I was also able to track
down an interface that is exposed to C, but 1.) already have a lengthy app
written in VB and 2.) don't know enough about C to write my own dll to do
this. Any ideas?


Perhaps using WMI. See:

http://groups.google.com/groups?selm...66%40rwcrnsc53
&oe=UTF-8

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #2
Thanks for the info, however, this only gives me the information for the NIC
configuration, not the DHCP address leases. I have an average DHCP
environment in a mid-sized company... 2 servers and 18 subnets. I need to
be able to report the address lease information from the DHCP servers using
VB .NET 2003 to cross-reference with SMS and some other reporting tools.
Any ideas other than using C# or C++?

"Patrick Steele [MVP]" <pa*****@mvps.org> wrote in message
news:MP************************@msnews.microsoft.c om...
In article <u1*************@TK2MSFTNGP11.phx.gbl>, ri*******@dyncfg.com
says...
Does anyone know if VB has an exposed API that can be used to query DHCP for current address leases? I have seen threads that discuss DHCPObj.dll and have successfully used it. However, this only exposed the server's
configuration, not the current address leases. I was also able to track
down an interface that is exposed to C, but 1.) already have a lengthy app written in VB and 2.) don't know enough about C to write my own dll to do this. Any ideas?


Perhaps using WMI. See:

http://groups.google.com/groups?selm...66%40rwcrnsc53
&oe=UTF-8

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele

Nov 20 '05 #3
In article <#S**************@TK2MSFTNGP12.phx.gbl>, ri*******@dyncfg.com
says...
Any ideas other than using C# or C++?


Sorry -- no. Never worked at the server-side of DHCP stuff. Your DHCP
server doesn't have any built-in reports that give you lease
information?

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #4
The DHCP MMC Console provides this information. However, almost every
environment I have worked in has multiple DHCP servers with multiple
subnets. The manual process that I'm currently performing is to pull this
data into a single "view" is to connect to each server using the DHCP MMC
Console and drill down into each subnet's | Address Leases and then do an
"export list" (standard MMC console feature thank goodness...). I save
these 36 csv files to the same folder with the same file name. I have an
Access database that I then open that has links to these csv files. The
Access database has only 1 local table. I run a Macro that runs a single
Delete query to empty out all of the old records from this table, then runs
36 Append queries (one for each linked csv file...), and then runs a Report
at the end that breaks down the information as it's correlated with data
from SMS, Domain Controllers, etc. What I'm trying to do is avoid the big
manual process of the MMC console "Export List" routine and the Access
database. I am trying to write a single VB .NET app that pulls the
information from the various places and generates a Crystal report. I can
pull off all of the data requests using ADO and ADSI except the DHCP Address
Leases. I have possibly found a C API call that can do his (there is of
course some way to access the data if the MMC console can do it, right!?).
However, I already have almost all of the app written in VB .NET and I'm not
a C expert. Any ideas?

-Rick Ford.


"Patrick Steele [MVP]" <pa*****@mvps.org> wrote in message
news:MP************************@msnews.microsoft.c om...
In article <#S**************@TK2MSFTNGP12.phx.gbl>, ri*******@dyncfg.com
says...
Any ideas other than using C# or C++?


Sorry -- no. Never worked at the server-side of DHCP stuff. Your DHCP
server doesn't have any built-in reports that give you lease
information?

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele

Nov 20 '05 #5
In article <uQ*************@TK2MSFTNGP12.phx.gbl>, ri*******@dyncfg.com
says...
I have possibly found a C API call that can do his (there is of
course some way to access the data if the MMC console can do it, right!?).
However, I already have almost all of the app written in VB .NET and I'm not
a C expert. Any ideas?


Is it a windows API that could possibly be called via PInvoke?

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #6
Thanks for following up on this...

I apologize for my lack of experience in dealing directly with API calls...
what is PInvoke? I'm asking this to understand the root of your question...
in the meantime, I'll go research what PInvoke is and get more up to speed!
:)

-Rick Ford.

"Patrick Steele [MVP]" <pa*****@mvps.org> wrote in message
news:MP************************@msnews.microsoft.c om...
In article <uQ*************@TK2MSFTNGP12.phx.gbl>, ri*******@dyncfg.com
says...
I have possibly found a C API call that can do his (there is of
course some way to access the data if the MMC console can do it, right!?). However, I already have almost all of the app written in VB .NET and I'm not a C expert. Any ideas?


Is it a windows API that could possibly be called via PInvoke?

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele

Nov 20 '05 #7
In article <eT**************@TK2MSFTNGP09.phx.gbl>, ri*******@dyncfg.com
says...
Thanks for following up on this...

I apologize for my lack of experience in dealing directly with API calls...
what is PInvoke? I'm asking this to understand the root of your question...
in the meantime, I'll go research what PInvoke is and get more up to speed!
:)


It's short for "Platform Invocation (or Invoke)". Look for "platform
invoke" in the .NET SDK documentation. It's a way for managed .NET code
to call into regular Win32 DLL's (such as Win32 API's).

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele
Nov 20 '05 #8
Thanks for all your help! I'm also looking into C# / C++ .NET to VB .NET
convertors to also see if one of them will help.

-Rick Ford.

"Patrick Steele [MVP]" <pa*****@mvps.org> wrote in message
news:MP************************@msnews.microsoft.c om...
In article <eT**************@TK2MSFTNGP09.phx.gbl>, ri*******@dyncfg.com
says...
Thanks for following up on this...

I apologize for my lack of experience in dealing directly with API calls... what is PInvoke? I'm asking this to understand the root of your question... in the meantime, I'll go research what PInvoke is and get more up to speed! :)


It's short for "Platform Invocation (or Invoke)". Look for "platform
invoke" in the .NET SDK documentation. It's a way for managed .NET code
to call into regular Win32 DLL's (such as Win32 API's).

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele

Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4255
by: Steve | last post by:
Hi, Have a database that contains various tables. I need to run a query on two tables. Table A contains a column called Titles Table B contains a column called Uni_Titles
1
2646
by: Wayne M J | last post by:
byte send = new byte; byte recv = new byte; send = 1; send = 1; send = 6; IPAddress ip = IPAddress.Parse("255.255.255.255"); IPEndPoint iep = new IPEndPoint(ip, 67); IPEndPoint iep2 = new...
1
2436
by: andrew_webby at hotmail | last post by:
Hi Anyone know a way I can (via .NET) query my dhcp server and enumerate all the scopes defined within? Been looking to no avail - it would appear a couple of guys asked this very question...
0
1396
by: Jack Black | last post by:
Any relatively painless way to query the domain DHCP server(s) to get a list of current leases by IP and machine name? Mucho thanks, Jack
2
2322
by: Jack Black | last post by:
Hi, all! Any way to query a DHCP server to get a list of current leases with machine name? Jack
5
7622
by: Richard | last post by:
Hello, I'm working on an application to allow our network team to use a small application to make DHCP reservations on our Microsoft DHCP Server. The problem is you have to use P/Invoke to do...
1
11102
by: Screenbert | last post by:
After finding nothing anywhere in google I am posting this so everyone can benefit by it. The formating is not pretty since I copied it from my word document, but you should benefit by it. ...
0
12317
by: screenbert | last post by:
Managing DHCP Servers using C# They said it was impossible. It couldn't be done. But you can in fact manage DHCP servers using C#. This includes creating and deleting Scopes, SuperScopes,...
7
3086
by: =?Utf-8?B?VGhlTWFkSGF0dGVy?= | last post by:
Quick q: If I open a socket on my computer and eventualy the dhcp changes the address of my computer, what happens? Will it drop the connection? Thanks in advance for any help on the topic.
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.