Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValidateResourceProperties always finds DhcpOption #31

Open
gordonbondon opened this issue Jul 26, 2016 · 0 comments
Open

ValidateResourceProperties always finds DhcpOption #31

gordonbondon opened this issue Jul 26, 2016 · 0 comments
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.

Comments

@gordonbondon
Copy link
Contributor

gordonbondon commented Jul 26, 2016

This

$dhcpOption = Get-DhcpServerv4OptionValue -ScopeID $ScopeID

never returns empty. According to technet article if not specified default Lease Duration for a scope will be 8 days.

Because of this Option 51 Lease Duration is always present in new scopes and ValidateResourceProperties always finds DHCP option so this part of code is never reached.

And this is called when it should not be called and as a side effect removes Lease Duration option and sets lease time to 0:0:0.

foreach($option in $dhcpOption.OptionID)
{
    Remove-DhcpServerv4OptionValue -ScopeId $ScopeID -OptionId $option
}

I've tested this behavior on freshly deployed 2012 R2 with lates xDhcpServer from PSGallery.

@kwirkykat kwirkykat added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

2 participants