473,799 Members | 3,053 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 13754
In article <u1************ *@TK2MSFTNGP11. phx.gbl>, ri*******@dyncf g.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.o rg> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
In article <u1************ *@TK2MSFTNGP11. phx.gbl>, ri*******@dyncf g.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*******@dyncf g.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.o rg> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
In article <#S************ **@TK2MSFTNGP12 .phx.gbl>, ri*******@dyncf g.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*******@dyncf g.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.o rg> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
In article <uQ************ *@TK2MSFTNGP12. phx.gbl>, ri*******@dyncf g.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*******@dyncf g.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.o rg> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
In article <eT************ **@TK2MSFTNGP09 .phx.gbl>, ri*******@dyncf g.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
4269
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
2675
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 IPEndPoint(IPAddress.Parse(ip, 68); UdpClient udp = new UdpClient(); udp.Send(send, send.Length, iep);
1
2449
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 fairly recently and received no response. I hope this doesn't mean it's impossible ! I have the DHCP mmc snap-in - been through the .net framework
0
1423
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
2346
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
7656
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 it, and from what I've found on the web and in this newsgroup is that it's not easy, however I believe it can/has been done. At the moment I'm just trying to find out information about an existing
1
11150
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. 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, Reservations, Exclusions, Options and so forth. Since the dll...
0
12361
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, Reservations, Exclusions, Options and so forth. Since the dll that is used was written several years ago by Microsoft, you cannot manage things on the DNS tab when looking at a reservation and few things such as that however it gives you main things you...
7
3101
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
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10473
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10249
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10219
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9068
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6804
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5461
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.