Automatically create DHCP addresses from the commandline

Automatically create DHCP addresses from the commandline

Automatically create DHCP addresses from the commandline 150 150 Roderick Derks

Create a csv file, each line contains :

 

10.20.220.0,10.20.221.238,00409D3C40FD,09-200-0277

 

10.20.220.0 = scope

10.20.221.238 = ip adress

00409D3C40FD = MAC adress

09-200.0277 = hostname

  

Then execute the following command that uses the file to make the reservations:

for /f “tokens=1-4 delims=,” %G IN (list.csv) do netsh dhcp server \\dhcp_servername scope %G add reservedip %H %I %J

 

Token-1-4 = select the 4 columns from above

List.csv = Bestand waar alle adressen in staan

Rest van de commando’s spreekt voor zich

 

Execute the following command as administrator:

for /f “tokens=1-4 delims=,” %G IN (list.csv) do netsh dhcp server \\dhcp_servername scope %G add reservedip %H %I %J

Roderick Derks

Liefhebber van fietsen, van het oplossen van IT puzzels, en van het delen van informatie om anderen te helpen.

All stories by:Roderick Derks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Your Name (required)

    Your Email (required)

    Subject

    Your Message

      Your Name (required)

      Your Email (required)

      Subject

      Your Message