Discussion:
scope lease time global change
(too old to reply)
RC
2009-07-15 19:03:01 UTC
Permalink
Does anyone know if there is a way to change the lease time on every
DHCP server at once without going to each and every scope?
Anderson Lacruz
2009-07-15 19:46:01 UTC
Permalink
Hi

Probably you have configurated scope options per each scope. Nevertheless,
you have the posibility to modify server options for all scope. That option
is available through the DHCP console at the end of the scopes. You can
configure every option that is equal for all scopes.

I recommend you verify the option that I'm mentioning you above in your DHCP
console and testing it in a LAB or test environment before doing the changes
in production.

I attach a link:
http://www.windowsnetworking.com/articles_tutorials/DHCP_Server_Windows_2003.html

I hope it can be helpful

Regards
Anderson L
Post by RC
Does anyone know if there is a way to change the lease time on every
DHCP server at once without going to each and every scope?
Anderson Lacruz
2009-07-15 19:52:02 UTC
Permalink
Hi

Probably you have configurated the scope options per each scope.
Nevertheless you have the option to configure the server options for all
scopes through DHCP console at the end of scopes.

I recommend you to verify the option that I mentioned above in your DHCP
console. Then you can test it in a LAB or test environment.

I attach a link
http://www.windowsnetworking.com/articles_tutorials/DHCP_Server_Windows_2003.html

You can see at the end of the web page to view the server options
I hope it can be helpful

Regards
Anderson L.
Post by RC
Does anyone know if there is a way to change the lease time on every
DHCP server at once without going to each and every scope?
RC
2009-07-15 20:28:52 UTC
Permalink
here is my scenario:

I have 1000 DHCP Scopes on 4 servers. each scope has a defined lease
time. (right click the scope, properties, Lease Duration Limited to:)

instead of me going to each scope and clicking properties and changing
the lease value from say 7 days to 14 days, does anyone know of a way
to make this change all at once? via script or something else?
Anderson Lacruz
2009-07-15 23:38:01 UTC
Permalink
Hi RC

Sorry for the confusion previously. I have some information that it is gonna
help you.
I attach this article
http://www.2000trainers.com/windows-scripting/manage-dhcp-netsh/

Here you are going to find a way to modify the lease time by command using
the netsh dhcp server...

Dhcp Server 192.168.2.5 Scope 192.168.3.0 set optionvalue 3 IPADDRESS
"192.168.2.2"
Dhcp Server 192.168.2.5 Scope 192.168.3.0 set optionvalue 6 IPADDRESS
"192.168.2.5" "192.168.2.6"
Dhcp Server 192.168.2.5 Scope 192.168.3.0 set optionvalue 51 DWORD "691200"

The first line sets the router for the scope. This is the gateway the
clients will use to leave the defined network. The second line assigns DNS
servers to the client leases and can include as many as needed. The third
line in this example assigns the expiration for the lease. In this case 8
days expressed in seconds (691200 seconds/60 = 11520 minutes/60 = 192
hours/24 = 8 days). Again, the changes can be verified in the MMC.

Options:
1. You can export or generate a DUMP with the configuration of the DHCP with
the next command:

Example:
C:\>netsh -c dhcp server 192.168.2.5 scope 192.168.2.0 dump > c:\test.txt

This file will contain all the info of your DHCP server. You can modify the
file just with scopes in order to apply the change for lease time in each
scope:
Example: In you case the number for 14 days will be 1209600
Dhcp Server 192.168.2.5 Scope 192.168.3.0 set optionvalue 51 DWORD "1209600"
Dhcp Server 192.168.3.5 Scope 192.168.3.0 set optionvalue 51 DWORD "1209600"
Dhcp Server 192.168.4.5 Scope 192.168.3.0 set optionvalue 51 DWORD "1209600"
Dhcp Server 192.168.4.5 Scope 192.168.3.0 set optionvalue 51 DWORD "1209600"

2. You can prepare a visual basic script to generate a file with the changes
indicated in the previous point with all scopes.

Remember to do this in a LAB or test environment before doing in production
with 1000 scopes

I hope this time the info can help you
Regards
Anderson Lacruz
Post by RC
I have 1000 DHCP Scopes on 4 servers. each scope has a defined lease
time. (right click the scope, properties, Lease Duration Limited to:)
instead of me going to each scope and clicking properties and changing
the lease value from say 7 days to 14 days, does anyone know of a way
to make this change all at once? via script or something else?
Marcin
2009-07-15 23:38:11 UTC
Permalink
you should be able to accomplish this using netsh utility - via its dhcp
server scope context - although this will require a bit of effort on your
part (you need to enumerate all scope and the for each invoke set
optionvalue command...

hth
Marcin
Post by RC
I have 1000 DHCP Scopes on 4 servers. each scope has a defined lease
time. (right click the scope, properties, Lease Duration Limited to:)
instead of me going to each scope and clicking properties and changing
the lease value from say 7 days to 14 days, does anyone know of a way
to make this change all at once? via script or something else?
Loading...