To improve Windows Server I suggest you ...

get-dhcpserverv4reservation command bug

get-dhcpserverv4reservation command

when use
Get-DhcpServerv4Reservation -ScopeId $ScopeId -ComputerName $DHCPServer -ClientId $ClientId
it returns the leased (not reserved) client IP if the ClientID exists and is active in the given scope
There is a workaround = collect all reservations for the given scope and search in the result against ClientID

2 votes
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)

We’ll send you updates on this idea

Michal Ziemba shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • James N commented  ·   ·  Flag as inappropriate

    I can confirm this is true. As discussed on https://github.com/MicrosoftDocs/windows-powershell-docs/issues/56#issuecomment-500798123 although it was closed there due to it not being the right place to report.

    How to replicate this problem: simply pick any IP address you know has a lease but is not a reservation:
    ----------------------------------

    H:\
    # Get-DhcpServerv4Reservation -ComputerName $dhcpserver -IPAddress 10.104.53.22 | fl IPAddress,ScopeID,AddressState

    IPAddress : 10.104.53.22
    ScopeId : 10.104.53.0
    AddressState : InactiveReservation

    H:\
    # Get-DhcpServerv4Reservation -ComputerName $dhcpserver -ScopeId 10.104.53.0 | ?{ $_.IPAddress -eq "10.104.53.22" }

    H:\
    #

    ----------------------------------
    Note that the first command incorrectly outputs the entry as if it was a reservation. The second command correctly outputs nothing, because there is no such reservation in this scope.

Feedback and Knowledge Base