Solved

Server 2003 DHCP Database 500 Point

Posted on 2006-06-21
7
614 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
Comment Utility
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
Comment Utility
0
 
LVL 82

Expert Comment

by:oBdA
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Author Comment

by:Jandakel2
Comment Utility
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 82

Accepted Solution

by:
oBdA earned 350 total points
Comment Utility
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
Comment Utility


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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
The HP utility "HP Lights-Out Online Configuration Utility for Windows Server 2003/2008" could be of great use when it comes to remotely configure a HP servers ILO WITHOUT rebooting the server. We would only need to create and run scripts using thi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now