![]() | Register | FAQ | Members | Social Groups | User Map | Calendar | Today's Posts | Search |
Windows
Windows forum sponsored by |
| ||
| | | LinkBack | Thread Tools | Search Thread |
| Sponsored Links |
| | #1 |
![]() | It would really help as I'm trying to put this network in order and get some order. Thanks in advance Gonk |
| |
| | #2 |
![]() Join Date: Oct 2006 Location: Warwickshire
Posts: 98
Thanks: 3
Thanked 29 Times in 15 Posts
Rep Power: 10 ![]() ![]() | I don't think you can do this from the GUI, but you should be able to with a bit of scripting. e.g. using vbscript and the NETSH command: Code: ' script to bulk create DHCP reservations from a .csv file
' Set a couple of constants
' Set following line to IP address of DHCP server, or leave blank for local computer
Const DHCPServer = ""
' Set following line to address scope where reservation is to be added
Const SCOPE = "192.168.1.0"
' Set following line to location of .csv file containing the reservation to be added
Const FileLocation = "C:\reservations.csv"
' read in the csv file
' format:
' <Reserved IP>,<MAC>,<Client Name>,<Description>
Const forReading = 1
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objCSVFile = objFSO.OpenTextFile(FileLocation,forReading)
' Process csv file
Do While objCSVFile.AtEndOfStream <> True
' read in a line from the csv file
strLine = objCSVFile.ReadLine
' seperate the cells on the line
arrCells = split(strLine,",",-1,1)
' get the values from the cells
strIP = arrCells(0)
strMAC = arrCells(1)
strClientName = arrCells(2)
strDescription = arrCells(3)
' build the NETSH command string
strCmd = "netsh dhcp server " & DHCPServer & " scope " & SCOPE & " add reservedip " & _
strIP & " " & strMAC & " " & strClientName & " """ & strDescription & """"
' run the NETSH command
objShell.Run strCmd, 1, TRUE
Loop
' All done so close the csv file
objCSVFile.close
' Clean up objects
Set objCSVFile = Nothing
Set objFSO = Nothing
Set objShell = Nothing
WScript.Echo "All done."
Hope that is of some help, Iain. |
| |
| | #3 |
![]() Join Date: Nov 2006 Location: Intergalactic Cruise
Posts: 687
Thanks: 17
Thanked 27 Times in 23 Posts
Rep Power: 11 ![]() ![]() | Use... netsh dhcp server \\servername dump >c:\dhcp.txt ... to get your current list. Look for the reservation section: Code: # ====================================================================== # Start Add ReservedIp to the Scope : IP of Server Server : IP of Server # ====================================================================== Dhcp Server SERVER-IP Scope SCOPE-IP Add reservedip RESERVEVED-IP MAC-ADDRESS "SomePC" "Description" "BOTH" then import the amended file with netsh exec c:\dhcp.txt Works a treat for us. HBJB |
| |
| The Following User Says Thank You to Heebeejeebee For This Useful Post: | Gonk (06-02-2009) |
| | #4 |
![]() | @Heebeejeebee & Iain Gents, Thanks for your help, DHCP now a lot more organised! Thanks for your help Gonk |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Access points not picking up DHCP reservations? | Halfmad | Networks | 2 | 26-04-2007 02:11 PM |
| What to do for best with DHCP reservations? | Kyle | Windows | 3 | 24-01-2007 11:11 PM |
| Script needed to check for file, rename and then copy a file | tosca925 | Scripts | 4 | 23-03-2006 06:27 AM |
| VPN +DHCP | Dos_Box | Networks | 7 | 30-09-2005 01:14 AM |
| DHCP | kingswood | Networks | 10 | 07-09-2005 06:29 AM |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|






