You can use something like this for setting the DNS/WINS server to 10.100.0.1
This scripts will work only locally on the DHCP server.
The “script” fill search all the scopes and then based on their names is setting the optionvalue 5, that is the DNS Server
for /F "tokens=6 delims= " %%A in ('netsh dhcp server dump^find "add scope"') do netsh dhcp server scope %%A set optionvalue 5 IPADDRESS "10.100.0.1"
For the WINS server you can use the optionvalue 44 if I’m remember well :
for /F "tokens=6 delims= " %%A in ('netsh dhcp server dump^find "add scope"') do netsh dhcp server scope %%A set optionvalue 44 IPADDRESS "10.100.0.1"
To use it for a specific DHCP server change it to :
for /F "tokens=6 delims= " %%A in ('netsh dhcp server IP_OF_DHCP_SERVER dump^find "add scope"') do netsh dhcp server IP_OF_DHCP_SERVER scope %%A set optionvalue 5 IPADDRESS "10.100.0.1"
Wednesday, September 3, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment