Query for current DHCP leases

  • Thread starter Thread starter Richard D. Ford
  • Start date Start date
R

Richard D. Ford

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?
 
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=8yQy9.10516$O71.4766@rwcrnsc53
&oe=UTF-8
 
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++?
 
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?
 
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.
 
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).
 
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.
 
Back
Top