Get scope router and scope duration and set it to 1 day

#################################################################################
##
## get scope router and scope duration and set it to 1 day
## Evert-Jan van de Keuken
## Date : 01-02-2017
## Version : 1.0
## Email: info@it-solved.nl
################################################################################
#get scope router and scop duration and set is to 1 day
$scopes = Get-DhcpServerv4Scope -ComputerName wvs-dhcp01
$lt = New-TimeSpan -Hours 24
foreach ($scope in $scopes)
{
$router = Get-DhcpServerv4OptionValue -ScopeId $scope.ScopeId -OptionId 3
write-host “$($scope.Name) / router $($router.Value)) / $($scope.LeaseDuration)”
#optional set the scope duration
Set-DhcpServerv4Scope -ScopeId $scope.ScopeId -LeaseDuration $lt
# $get = Read-Host
}

Geplaatst in DHCP, Powershell, Scripting.