What command can I run to change all the lease times on all the scopes?


  • I have this so at a time

    PS C:\Windows\system32>Set-DhcpServerv4Scope –ComputerName dhcpserver01 -ScopeID -LeaseDuration (New-TimeSpan -Hours 4)

    I just dont want to enter all 150 scopes so any help would be appreciated.

    Wednesday, April 19, 2017 9:11 PM


All replies

  • Get-DhcpServerv4Scope  –ComputerName dhcpserver01  | Set-DhcpServerv4Scope -LeaseDuration (New-TimeSpan -Hours 4)


    Wednesday, April 19, 2017 9:27 PM
  • thank you , thank you!!!  i only had to alter it just a tad but you saved me a TON of time!!!

    Get-DhcpServerv4Scope –ComputerName dhcpserver01  | Set-DhcpServerv4Scope -ComputerName dhcpserver01 -LeaseDuration (New-TimeSpan -Hours 4)

    Thursday, April 20, 2017 1:09 PM
  • i now this is probably not the right spot for this question but do you know how to do the same thing for an old Win2003 DHCP server as the powershell commands don't work with it?  thanks again for all the help!!!
    Thursday, April 20, 2017 1:11 PM
  • WS2003 is no longer supported.  There are no DHCP commands for a WS2003 DHCP server.  YOU might be able to makes some changes using netsh.


    Thursday, April 20, 2017 6:22 PM