This is the script that I used to add our new wireless access points. It's a cmd file which relies on two external text files for input - they should be saved in the same folder as the cmd file. The first (servers.txt) lists the IP addresses of your DHCP servers, because you'll want to make the reservations on all of them; we have two. The second (wapmacs.txt) lists the details of the objects for which you want to make a reservation. It will need to contain as tab separated values the IP address you want to reserve for the object, the MAC address of the object, the name of the object and (optionally) a description for the object.
NOTE: as it stands, this code will simply echo the parameters it finds and the netsh command it creates; it won't do anything, it's in test mode. To use it in anger you'll need to uncomment the netsh line and comment the echoes and pauses below :listit. Use it at your own risk - I won't be responsible for consequences.
FOR /F %%b IN (%~dp0servers.txt) DO @call :perserver %%b
FOR /F "delims=," %%c IN (%~dp0WAPMACs.txt) DO call :listit %1 %%c
echo %1 + %2 + %3 + %4
::netsh dhcp server %1 scope xx.xx.xxx.0 add reservedip %2 %3 %4
echo netsh dhcp server %1 scope xx.xx.xxx.0 add reservedip %2 %3 %4
Examples of the content of the accompanying files:
xxx.xxx.xxx.105 00156CD656B0 WirelessAP29 "Wireless Access Point"
xxx.xxx.xxx.106 00156CD656B1 WirelessAP30 "Wireless Access Point"
xxx.xxx.xxx.107 00156CD656B2 WirelessAP31 "Wireless Access Point"