I've used dhcpobjs.dll for this in the past, it was very simple. I think
it's in the Windows 2000 Server Resource Kit tools, but I'm not sure. I
have VB code I could share with you, but not VBScript.
You could also try netsh.exe, I think it will do what you want. You might
need to add the DHCP helper like this:
C:\>netsh.exe
netsh>add helper dhcpmon.dll
Ok.
netsh>dhcp
netsh dhcp>?
list - Lists all the commands available.
dump - Dumps configuration to a text file.
help - Displays help.
? - Displays help.
add - Adds a configuration entry to a table.
delete - Deletes a configuration entry from a table.
show - Displays information.
server [\\servername/ipaddress] - To switch the context to the server
specified.
A Null implies the local machine.
netsh dhcp>server 10.10.10.1
netsh dhcp server>?
list - Lists all the commands available.
dump - Dumps configuration to a text file.
help - Displays help.
? - Displays help.
add - Adds a configuration entry to a table.
delete - Deletes a configuration entry from a table.
export - Exports the configuration to a file.
import - Imports the configuration from a file.
initiate - Initiates an operation.
set - Sets configuration information.
show - Displays information.
scope <scope-ip-address> - To switch to the scope identified by
the IP Address.
mscope <mscope-name> - To switch to the mscope identified by
the MScope name.
netsh dhcp server>list
list - Lists all the commands available.
dump - Dumps configuration to a text file.
help - Displays help.
? - Displays help.
add class - Adds a class to the server.
add mscope - Adds a multicast scope to the server.
add optiondef - Adds a new option to the server.
add scope - Adds a scope to the Server.
delete class - Deletes a specific class from the server.
delete dnscredentials - Sets the credentials to use for DNS
updates
delete mscope - Deletes a multicast scope from the Server.
delete optiondef - Deletes an option from the Server.
delete optionvalue - Deletes an option value from the server.
delete scope - Deletes a scope from the Server.
delete superscope - Deletes a superscope from the Server.
export - Exports configuration of the server.
import - Imports configuraiton of the server.
initiate auth - Initiates retry authorization with the
server.
initiate reconcile - Checks and reconciles the database for all
scopes under the server.
set auditlog - Sets the audit log parameters for the
server.
set databasebackupinterval - Sets the database backup interval of the
current server.
set databasebackuppath - Sets the database backup path for the
Server.
set databasecleanupinterval - Sets the database clean up interval.
set databaseloggingflag - Sets/resets the database logging flag.
set databasename - Sets the name of the server database file.
set databasepath - Sets the path of the server database file.
set databaserestoreflag - Sets/Resets the database restore flag.
set detectconflictretry - Sets the number of conflict detection
attempts
by the DHCP server.
set dnscredentials - Sets the credentials to use for DNS updates
set dnsconfig - Sets the Dynamic DNS configuration for the
Serve
r.
set optionvalue - Sets the global option value for the Server.
set server - Sets the current server in the Server mode.
set userclass - Sets the global user class name for
subsequent operation.
set vendorclass - Sets the global vendor class name for
subsequent operation.
show all - Displays all information for the Server.
show auditlog - Displays the Audit log settings for the
server.
show bindings - Displays Binding information for the server.
show class - Displays all available classes for the
Server.
show detectconflictretry - Displays the detect conflict retry settings.
show dnsconfig - Displays the dynamic DNS configuration for
the
server.
show dnscredentials - Displays the currently set DNS credentials.
show mibinfo - Displays MIBInfo for the Server.
show mscope - Displays all multicast scopes for the
Server.
show optiondef - Displays all options for the Server.
show optionvalue - Displays all optionvalues that are set for
the
server.
show scope - Displays all available scopes under the
Server.
show server - Displays the current Server.
show dbproperties - Displays server database configuration
information.
show serverstatus - Displays the current status for the Server.
show userclass - Displays the currently set user class name.
show vendorclass - Displays the currently set vendor class
name.
show version - Displays the current version of the Server.
scope <scope-ip-address> - To switch to the scope identified by
the IP Address.
mscope <mscope-name> - To switch to the mscope identified by
the MScope name.
Post by James Tee StainHiYa,
Anyone got any quick links or coding to access the IP address of a reserved
machine (server, router, printer, RIB card etc) in a Windows 2000 DHCP
server using VB Scripting.
I can only find C++ stuff which is leagues above my head and also banned
(anyway) for security reasons, as the code needs to be transparent to anyone
who wishes to check it.
TIA.
James.