Solved

Server 2003 DHCP Database 500 Point

Posted on 2006-06-21
7
616 Views
Last Modified: 2008-01-09
Hello All,
I am looking at doing a DHCP Scope, but by reservation only.  I currently have a database of all my machines MAC addresses and their associated Static IP's.  This database also contains machine name, and all hardware specs on each PC.  I'm curious to know if I can manipulate the Server's DHCP Database in such a way that I can just import the .txt or .csv file into the database and the Reservations will automatically be applied/assigned.  Please tell me it's possible!!

Thanks JK
0
Comment
Question by:Jandakel2
7 Comments
 
LVL 8

Expert Comment

by:SanDiegoComputer
ID: 16953934
You can import and export dhcp scopes via the NETsh utility.  

Here is an article about how to use this:
http://support.microsoft.com/kb/281626/en-us


Basically in netsh:
dhcp server \\servername
export c:\backup\dhcpdb all

to import
dhcp server \\servername
import c:\backup\dhcpdb all
0
 
LVL 7

Expert Comment

by:CharliePete00
ID: 16953973
0
 
LVL 83

Expert Comment

by:oBdA
ID: 16954343
Basically yes, with a netsh command and a little script.
The necessary syntax is
netsh dhcp server \\<YourDHCPServer> scope <YourScope> add reservedip <YourIP> <YourMACAddress> <YourClientName>
Are those machines all in one scope?
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 4

Author Comment

by:Jandakel2
ID: 16954404
Yes, all those machines will be in one scope, I already have the scope built with a few in it with reservations, but I want to import the remainder instead of doing it manually, kind of batch it in....you know?

JK
0
 
LVL 83

Accepted Solution

by:
oBdA earned 350 total points
ID: 16954763
Then export the machine name, the IP address, the MAC address (needs to be one string, 112233445566), and a description (in this order; description is optional) to a comma separated text file, "reservations.txt".
Then run the following script (after adjusting the server and the scope, obviously).
Note that I can't test this currently; you might want to try this with a list with only a few entries first.

@echo off
setlocal
set DHCPServer=YourDHCPServer
set Scope=192.168.0.1
for /f "tokens=1-4 delims=;" %%a in ('type reservations.txt') do (
  echo Processing %%a ...
  set Name=%%a
  set IP=%%b
  set MAC=%%c
  set Description=%%d
  netsh dhcp server \\%DHCPServer% scope %Scope% add reservedip %IP% %MAC% %Name% "%Description%" BOTH
)
0
 
LVL 15

Assisted Solution

by:markpalinux
markpalinux earned 150 total points
ID: 16958825


OBda,

I like your approach, I find excel much eaiser for this type of stuff.

netsh dhcp server \\<YourDHCPServer> scope <YourScope> add reservedip <YourIP> <YourMACAddress> <YourClientName>

New Excel File
In Column A have the <YourIP>,
in Column B have <YourMacAddress>,
in Column C have <YourClientName>,
 then in
Cell D1 enter ="netsh dhcp server \\<YourDHCPServer> scope <YourScope> add reservedip "&a1&" "&B1&" "& <YourClientName>

Then copy D1 down to Dxx, then cut and paste D1 into a cmd file and run it.

Mark

0
 
LVL 4

Author Comment

by:Jandakel2
ID: 16969402
These both look like good approaches.  I will be making the IP Migration later on this summer, so I will repost if possible.  Thanks for the advice!

JK
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This may not be a text book method to resolve VSS backup issues but it seemed to have worked on few of the Windows 2003 servers we had issues while performing a Volume Shadow Copy backup. If you have issues while performing a shadow copy backup usin…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question