Powershell Set-NetAdapter Command trows error

Leon 21 Reputation points
2021-09-18T10:34:38.69+00:00

Hey Everyone, My PS Set-NetAdapter command does not work anymore, It worked always, now it stopped working.
I get the following error when trying to run it

PS C:\Windows\system32> Set-NetAdapter -Name "Ethernet" -MacAddress "B4-2E-99-17-6D-PP"
Set-NetAdapter : Mindestens einer der an die Methode übergebenen Parameterwerte war ungültig.
In Zeile:1 Zeichen:1
+ Set-NetAdapter -Name "Ethernet" -MacAddress "B4-2E-99-17-6D-PP"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (MSFT_NetAdapter...ame = "LeonPC"):ROOT/StandardCimv2/MSFT_NetAdapter)
   [Set-NetAdapter], CimException
    + FullyQualifiedErrorId : MI RESULT 4,Set-NetAdapter

PS C:\Windows\system32>
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,362 questions
{count} votes

Accepted answer
  1. Limitless Technology 39,351 Reputation points
    2021-09-20T10:42:40.88+00:00

    Hello,

    Thanks for reaching out.

    As per Microsoft guide related to MAC address parameter

    Specifies the current MAC address of the network adapter. Dashes are optional as part of the input. Not all network adapters support setting the MAC address. The address passed in is also saved in the network addresses property without dashes.

    Example : Set-NetAdapter -Name "Ethernet2" -MacAddress "00-10-18-57-1B-0D"

    https://learn.microsoft.com/en-us/powershell/module/netadapter/set-netadapter?view=windowsserver2019-ps

    Thank you.


0 additional answers

Sort by: Most helpful