Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

WIN2008 R2 clients convert from static IP to dhcp

Posted on 2014-01-18
8
Medium Priority
?
358 Views
Last Modified: 2014-01-24
Hello,
on a 800 winxp wks recently migrated to win 2008 R2 domain ( consists of 10 subnets ), is needed to change IP from static to dynamic but it is mandatory to keep the existing ip address.

Are there ways to import onto dhcp scopes ?

Changing from static to dhcp directly from tcp/ip setting will keep the existing IP ? ( if yes a script can be developed and configured in one GPO.

Thanks a lot!
0
Comment
Question by:pablito70
8 Comments
 
LVL 70

Expert Comment

by:KCTS
ID: 39791008
With DHCP there is no guarantee that machines will get the same IP address unless you specify reservations for IPs.
0
 
LVL 10

Expert Comment

by:Korbus
ID: 39791011
I'm not quite sure I understand your question.  I hope I'm not just stating what you already know.

You will need to specify in your DHCP reservations, both the mac address and IP address of each PC.   If you do this first, then yes, when you change the workstation to DHCP it will be assigned the same address.
0
 
LVL 25

Assisted Solution

by:Zephyr ICT
Zephyr ICT earned 200 total points
ID: 39791026
Like the other experts mentioned, you'll have to turn all the fixed IP-addresses into DHCP reservations...

There's some scripts out there on the Internet that could get you started with that if need be:

For example:

http://community.spiceworks.com/how_to/show/9060-import-dhcp-reservations-from-csv-via-powershell
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
LVL 2

Author Comment

by:pablito70
ID: 39791034
Hello, thanks for quick reply.
Reservation is the deal, but considering 800 macadresses and related IP, adding manually from DHCP snap-in will takes a long long time ... Is there a way , through netsh for example, to import data ? Of course the lan administrators already have a plain text database with AD machine names, macaddress, ip addres, vlan.

So the input file is ready ( and can be modified as per needs ).

What is missing how to import ...
0
 
LVL 14

Accepted Solution

by:
Don Thomson earned 1800 total points
ID: 39791098
You may be able to do this :

(from http://social.technet.microsoft.com/Forums/en-US/0d3e7bf1-632d-46e0-926b-db8b27d041ed/2008-r2-dhcp-importing-reservations


The commandline format for specifying Reservations is as follows:

NetSh Dhcp Server [DHCP_SERVER_IP] Scope [SCOPE] Add reservedip [RESERVED_IP] [MAC] "[RES_NAME]" "[DESCRIPTION]" "[BOOTP/DHCP/BOTH]"

example:

NetSh Dhcp Server 10.1.0.1 Scope 10.1.0.0 Add reservedip 10.1.0.10 00123456789A "PC1" "PC1-2008R2" "BOTH"

 

If you add all reservations in a text file, you can run (make sure you take the NetSh bit off the line if you put it into a file):

NetSh Exec [FOLDER_LOCATION\FILE.NAME]

 

You can also extract a current DHCP configuration by running:

NetSh DHCP Server Dump > [FOLDER_LOCATION\FILE.NAME]

 

On a side note, if you want to create reservations in 2008 / R2, you need to create a scope which covers the entire range you want to use, and then add an exclusion range for addresses you dont want to be issued by DHCP
0
 
LVL 70

Expert Comment

by:KCTS
ID: 39791527
Turning the question around a little - why is necessary for all machines to retain the same IP address ?
0
 
LVL 17

Expert Comment

by:vivigatt
ID: 39792879
I am not certain that the following will work, but I think it should:
Create temporary reservations for each client and use a long enough lease time.
Once a client has received a particular IP address from DHCP, it will usually try to get the same address again and again, especially if its dhcp lease has not expired.
This way, you should be reasonably sure that the client will get the "same" IP address and yet have the flexibility of a true dhcp, without reservations.

Creating reservations can be done with netsh, but I must admit that it would be better if it could be done from the client side (since they "know" their own IP and mac address). Yet, running netsh on a client so that it adds a dhcp reservation on a remote dhcp server is not an easy thing, if even doable. You could use psexec for that, but it may have some drawbacks.
0
 
LVL 14

Expert Comment

by:Don Thomson
ID: 39794123
If you created a batch file to create each reservation it could all be run right on the server - no need to run it at each workstation.   This is assuming that you currently have a file that contains all the current IPs and MAC addresses of all your users.
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

OfficeMate Freezes on login or does not load after login credentials are input.
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Suggested Courses

971 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