--- Start of Rant ---
Let me tell you something. Sometimes in IT you're stuck with an unenviable task of scripting mass changes to AD, you've got the starting point - the requirements and the objects that need to be changed, you have somehow managed to extract the data required to be changed. Now you need to eye-ball both spread sheets line by line to make sure you can produce the script that will update the required attributes.
It's not fun.
--- End of Rant ---
With this it will be fun:
http://www.techonthenet.com/excel/formulas/vlookup.php
Just happy sharing nuggets. My Personal Wiki. Blog contains mostly technical stuff which may be of interest to some but mostly useful for me.
Showing posts with label extract. Show all posts
Showing posts with label extract. Show all posts
Wednesday, July 17, 2013
Tuesday, March 27, 2012
HOWTO: Shortcuts to managing DHCP in enterprise environments
How to extract MAC address from DHCP reservations
netsh dhcp server dump >> reservationdump.txt
find “Add reservedip” reservationdump.txt >> reservations.csv
Updated June 26, 2012
Had another issue at work where I had to merge two DHCP scopes that divided a single segment between the scopes. Each scope controlled a range of IP addresses (Scope #1, .1 - .127, Scope #2, .128 - 254).
Both of the scopes had custom scope attributes defined.
One of the scopes had reservations defined.
To make matters more interesting, the subnet mask had to be changed from /25 (255.255.255.128) to /24 (255.255.255.0) - DHCP scope allows you to edit the defined range but the subnet mask is greyed out.
Lastly, a new scope had to be created under a new segment based on one of the old scopes above.
How to merge scopes without losing custom settings and re-doing reservations:
A variation of the commands at the start of this post will get you a text dump.
(Note there are two kinds of export data; binary and text and they are not interchangable)
If you need to quickly modify a scope on DHCP, eg, delete a scope and recreate all the reservations in a new scope, the above technique with the following steps will make it easier.
1. Export the scopes: netsh dhcp server dump >> dump.txt
2. Edit the exported file (you can safely delete the other non applicable scopes)
3. Import the exported file using this command: netsh exec c:\dump.txt
You may encounter these errors when you try to export DHCP server configuration (binary):
"An attempt was made to load a program with an incorrect format" - Hotfix solution from Microsoft
"Access denied" error message when you use the "netsh dhcp server import" - Binary Export/Import DHCP database steps
References:
Netsh commands for DHCP
Starting point for solution:
HOWTO: Import and Export DHCP reservations in server 2003
netsh dhcp server dump >> reservationdump.txt
find “Add reservedip” reservationdump.txt >> reservations.csv
Updated June 26, 2012
Had another issue at work where I had to merge two DHCP scopes that divided a single segment between the scopes. Each scope controlled a range of IP addresses (Scope #1, .1 - .127, Scope #2, .128 - 254).
Both of the scopes had custom scope attributes defined.
One of the scopes had reservations defined.
To make matters more interesting, the subnet mask had to be changed from /25 (255.255.255.128) to /24 (255.255.255.0) - DHCP scope allows you to edit the defined range but the subnet mask is greyed out.
Lastly, a new scope had to be created under a new segment based on one of the old scopes above.
How to merge scopes without losing custom settings and re-doing reservations:
A variation of the commands at the start of this post will get you a text dump.
(Note there are two kinds of export data; binary and text and they are not interchangable)
If you need to quickly modify a scope on DHCP, eg, delete a scope and recreate all the reservations in a new scope, the above technique with the following steps will make it easier.
1. Export the scopes: netsh dhcp server dump >> dump.txt
2. Edit the exported file (you can safely delete the other non applicable scopes)
3. Import the exported file using this command: netsh exec c:\dump.txt
You may encounter these errors when you try to export DHCP server configuration (binary):
"An attempt was made to load a program with an incorrect format" - Hotfix solution from Microsoft
"Access denied" error message when you use the "netsh dhcp server import" - Binary Export/Import DHCP database steps
References:
Netsh commands for DHCP
Starting point for solution:
HOWTO: Import and Export DHCP reservations in server 2003
Labels:
Command Line,
DHCP,
DHCP reservations,
DHCP scopes,
dump,
export,
extract,
fast,
MAC,
merge DHCP,
migrate DHCP scopes,
netsh,
Quick and dirty,
transfer DHCP scopes,
Windows,
Windows 2003
Subscribe to:
Posts (Atom)