Having two ISP connections and switch between them automatically is more a hardware (or Software -TMG) solution. But I found a way to script the Windows DHCP server using the netsh command.
This allows for a site admin to run either of two scripts to change the default gateway on the server(s) and dhcp scope options for clients.
An example of such script:
netsh Dhcp Server \\192.168.0.1Scope 192.168.0.0 set optionvalue 3 IPADDRESS “192.168.0.2”
netsh interface ipv4 delete route 0.0.0.0/0 “Local Area Connection” 192.168.0.2
netsh interface ipv4 delete route 0.0.0.0/0 “Local Area Connection” 192.168.0.3
netsh interface ipv4 add route 0.0.0.0/0 “Local Area Connection” 192.168.0.2
The netsh dhcp servercommand changes the scope with the ip addressing of 192.168.0.0 on server \\192.168.0.1 to use the first ISP of 192.168.0.2.
The next netsh commands clear out and set the default router ip address on the Local Interface named ‘Local Area Connection’.
A second batch is given to the site admin to change the same setting but use the second ISP default router ip address of 18.104.22.168.
The netsh command looks like a very powerful tool. From this you can export out the full DHCP server settings and use the output file to create a new dhcp server on other hardware. Without changing a line of the exported file, just like Cisco IOS config files.
Note: The clients do not see the change of default router until they renew their IP address.This could be expanded I know, my scripting head is crying for a ping check on change ISP automatically….