How to Bulk import DHCP Reservation of IP Address that is not leased out yet
Create an excel spread sheet, the data value of the excel spreadsheet must be like below
ScopeId,IPAddress,Name,ClientId,Description
10.10.10.0,10.10.10.10,Computer1,1a-1b-1c-1d-1e-1f,Reserved for Computer1
20.20.20.0,20.20.20.11,Computer2,2a-2b-2c-2d-2e-2f,Reserved for Computer2
30.30.30.0,30.30.30.12,Computer3,3a-3b-3c-3d-3e-3f,Reserved for Computer3
Below is a screenshot of what the excel sheet should look like

Important – Scope ID should be the first octate of the subnet. Generally 0 in most cases
Save the excel sheet in .csv format
Log in to the DHCP server
Open Powershell
Disable powershell security by running below command
Set-execution policy remotesigned
Or
Set-execution policy unrestricted
Now navigate to the location where you saved the above .csv file and run the below command
Import-csv example.csv | add-dhcpserverv4reservation
In my case the location of the csv file was C:\Temp
So my powershell command looks like below

Important thing to remember, as you can see above, make sure all the mac address is correct, otherwise you will get error message like above.
If you want to know what commands are available for powershel module for DHCP server
Then open powershell and type below command
Get-command –module dhcpserver
You should be able to tab your way through the command most of the time.
Enjoy powershelling.




Leave a Reply