Solved

Server 2003 DHCP Database 500 Point

Posted on 2006-06-21
7
617 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server Login Issue 4 65
Moving RDP Server to New Server. 3 71
Active Directory delegation of control to a user 3 137
Automate Windows Updates with SCCM 2 80
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.…
I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

735 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