Windows Server 2016 Hyper-V and New-NetNat error 87

nadsad 1 Reputation point


I keep getting "Windows System Error 87" when trying to create the second NAT via PowerShell.

As you can see below i created the first on and then trying to create the other one but i keep getting the error.

Any ideas of why?


Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,454 questions
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,601 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Limitless Technology 39,476 Reputation points

    Hello @nadsad

    I have experienced the issue before, and the error is quite generic and misleading,

    In my case it happened that for a reason, the the cmdlet worked in first place, due to some unexplained issue, the Get-NetNat was not showing the new created Nat.

    Can you try to remove the Nat you are creating, with Remove-NetNat, and then run your New-NetNat?

    Hope it helps!

    0 comments No comments

  2. nadsad 1 Reputation point


    Thank you for the reply.

    Unfortunately I have already tried. So I remove the NAT with Remove-NetNat and then I have no more NATs. I run New-NetNat for the first NAT and it works but then when I run it again to create second NAT I get the error.

    0 comments No comments

  3. Limitless Technology 39,476 Reputation points

    Hello again,

    Error 87, commonly known as ERROR_INVALID_PARAMETER and described as The parameter is incorrect.

    A possible cause for the failure is that the Offset and OffsetHigh members of the OVERLAPPED structure are not set to zero.

    In many cases, the function calls may succeed if you do not explicitly set OVERLAPPED.Offset and OVERLAPPED.OffsetHigh to zero. However, this is usually either because the OVERLAPPED structure is static or global and therefore is initialized to zero, or the OVERLAPPED structure is automatic (local) and the contents of that location on the stack are already zero. You should explicitly set the OVERLAPPED.Offset and OVERLAPPED.OffsetHigh structure members to zero.

    Hope this answers all your queries, if not please do repost back.
    If an Answer is helpful, please click "Accept Answer" and upvote it : )


    0 comments No comments

  4. nadsad 1 Reputation point

    Honestly im not quite sure what im supposed to do with that answer :)

    0 comments No comments