Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - dhcpobjs.dll: Problems accessing reservations in scopes larger than/24 (class C)

Reply
 
Old 08-01-2008   #1 (permalink)
Boon


 
 

dhcpobjs.dll: Problems accessing reservations in scopes larger than/24 (class C)

Hi,

I have a few VB Scripts I have put together in order to manage
reservations on a Win2000 DHCP server, and I was pretty happy with the
way they were working until I tried to manipulate a reservation in a
scope that was larger than a /24 (class C) network.

I can access the scope information fine e.g. (assuming a scope address
of 192.168.8.0 on a /23 network, mask 255.255.254.0, with DHCP server
address 192.168.1.1):


Set dhcpsrvr = dhcpmgr.Servers.Connect("192.168.1.1")

Set Scope= dhcpSrvr.Scopes("192.168.8.0")

WScript.Echo Scope.Address
WScript.Echo Scope.Name
WScript.Echo Scope.StartAdress
WScript.Echo Scope.EndAddress
WScript.Echo Scope.Parent
WScript.Echo Scope.Comment & vbCrLF

dhcpmgr.Servers(1).Disconnect


Returns all the requested information without any problem. If however
I try to access an individual reservation within scope 192.168.8.0,
say 192.168.9.32:


Set dhcpsrvr = dhcpmgr.Servers.Connect("192.168.1.1")

Set Reservation =
dhcpSrvr.Scopes("192.168.8.0").Reservations("192.168.9.32")

WScript.Echo Reservation.Address
WScript.Echo Reservation.Name
WScript.Echo Reservation.UniqueID
WScript.Echo Reservation.Parent
WScript.Echo Reservation.Comment & vbCrLF

dhcpmgr.Servers(1).Disconnect


The script fails with error:

C:\>cscript //NoLogo getReservation.vbs

C:\getReservation.vbs(21, 2) (null): More data is available.

Where line 21 in the above script would be:

Set Reservation =
dhcpSrvr.Scopes("192.168.8.0").Reservations("192.168.9.32")

If I changed the Scope and Reservation address in the script to refer
to a scope of size /24 or smaller it works perfectly.

Now I realise dhcpobjs.dll is sparsely documented and probably no
longer appropriate, but other than this issue it works very well for
the specific area we use it.

Can anyone shed any light on this problem?

Thanks in advance


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
When a class is both an inherited class of another, and alsoimplements an interface method .NET General
Problems Accessing Web Folders Vista networking & sharing
DHCP Scopes Vista General
Problems with accessing this newsgroup Vista performance & maintenance
Re: Problems accessing some webpages Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46