Solved

Server 2003 DHCP Database 500 Point

Posted on 2006-06-21
7
618 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 84

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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 84

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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.

752 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