PowerShell for Windows Admins

Jan 7 2015   2:27PM GMT

DHCP scope lease time

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Tags:
DHCP
Powershell
Windows Server 2012
Windows Server 2012 R2

I wanted to reduce the lease time on a DHCP scope

$lt = New-TimeSpan -Hours 12
Set-DhcpServerv4Scope -ScopeId 10.10.54.0 -LeaseDuration $lt

You could even make it a one liner if you wished

Set-DhcpServerv4Scope -ScopeId 10.10.54.0 –LeaseDuration (New-TimeSpan -Hours 12)

2  Comments on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.
  • cfizz3434
    Is it possible to do it for all the scopes on a particular DHCP server all in a one line command?
    10 pointsBadges:
    report
  • Richard Siddaway
    You can do it in one PowerShell pipeline - I'll post an example
    9,515 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: