Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Server 2003 DHCP Database 500 Point

Posted on 2006-06-21
7
Medium Priority
?
620 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 85

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 85

Accepted Solution

by:
oBdA earned 1400 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 600 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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

721 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