locked
Disable NetAdapter Power Management on 2012 R2 not work as expected RRS feed

  • Question

  • Hi,

       I am working on Windows Server 2012 R2 Standard(published in 2013), and tried to disable network adapter power management by powershell,

    PS C:\> Get-NetAdapter -InterfaceDescription "Oracle VM*" |Format-List


    Name                       : Ethernet 3
    InterfaceDescription       : Oracle VM Virtual Ethernet Adapter
    InterfaceIndex             : 14
    MacAddress                 : C6-B0-F6-F9-9B-7E
    MediaType                  : 802.3
    PhysicalMediaType          : 802.3
    InterfaceOperationalStatus : Up
    AdminStatus                : Up
    LinkSpeed(Gbps)            : 10
    MediaConnectionState       : Connected
    ConnectorPresent           : True
    DriverInformation          : Driver Date 2016-11-10 Version 3.4.2.1757 NDIS 6.0

    Then Disable and check the result, but "AllowComputerToTurnOffDevice" is still enabled :

    PS C:\Users\Administrator> Disable-NetAdapterPowerManagement -Name "Ethernet 3"
    PS C:\Users\Administrator> get-netadapterpowermanagement -name "Ethernet 3" | format-list -property *


    ifAlias                      : Ethernet 3
    InterfaceAlias               : Ethernet 3
    ifDesc                       : Oracle VM Virtual Ethernet Adapter
    AllowComputerToTurnOffDevice : Enabled
    D0PacketCoalescing           : Unsupported
    DeviceSleepOnDisconnect      : Inactive
    ArpOffload                   : Unsupported
    NSOffload                    : Unsupported
    RsnRekeyOffload              : Unsupported
    SelectiveSuspend             : Unsupported
    WakeOnMagicPacket            : Unsupported
    WakeOnPattern                : Unsupported
    Caption                      : MSFT_NetAdapterPowerManagementSettingData 'Oracle VM Virtual Etherne
    Description                  : Oracle VM Virtual Ethernet Adapter
    ElementName                  : Oracle VM Virtual Ethernet Adapter
    InstanceID                   : {23DFC749-2AA2-44D6-ADA5-5906B7C6236C}
    InterfaceDescription         : Oracle VM Virtual Ethernet Adapter
    Name                         : Ethernet 3
    Source                       : 2

    How can I disable the Virtual Ethernet Adapter power management by powershell commands?

    PS. Because I want to add this disabling in an automatic execution pipeline, so I don't want to use a hard-coded registry key to disable it.

    Wednesday, January 3, 2018 2:51 AM

All replies

  • Get-NetAdapterPowerManagement lan | Disable-NetAdapterPowerManagement
    Get-NetAdapterPowerManagement lan

    Works as expected.


    \_(ツ)_/

    Wednesday, January 3, 2018 3:20 AM
  • Hi,Thanks for your reply, but seems I did not find "lan" on my server

    PS C:\Users\Administrator> Get-NetAdapterPowerManagement lan | Disable-NetAdapterPowerManagement

    Get-NetAdapterPowerManagement : No MSFT_NetAdapterPowerManagementSettingData objects found with property 'Name' equal

    to 'lan'.  Verify the value of the property and retry.

    At line:1 char:1

    + Get-NetAdapterPowerManagement lan | Disable-NetAdapterPowerManagement

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : ObjectNotFound: (lan:String) [Get-NetAdapterPowerManagement], CimJobException

        + FullyQualifiedErrorId : CmdletizationQuery_NotFound_Name,Get-NetAdapterPowerManagement

    Is there anything I missed? 


    Monday, January 8, 2018 6:46 AM
  • Hi,

    Based on the first post, you may need to replace "lan" to "Ethernet 3" and run the command again to see if it works.
    You can also run Get-NetAdapterPowerManagement | Select-Object Name to get the correct name.

    Please let us know if you would like further assistance.

    Best Regards,
    Albert

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, January 8, 2018 9:19 AM
  • I use following command, but still not work, the pv driver is installed

    PS C:\Users\Administrator> Get-NetAdapterPowerManagement | Select-Object Name

    Name
    ----
    Ethernet 3

     PS C:\users\Administrator > Get-NetAdapterPowerManagement "Ethernet 3" |Disable-NetAdapterPowerManagement

    But AllowComputerToTurnOffDevice is still enabled. 

    PS C:\Users\Administrator> Get-NetAdapterPowerManagement "Ethernet 3" | Format-list -property *


    ifAlias                      : Ethernet 3
    InterfaceAlias               : Ethernet 3
    ifDesc                       : Oracle VM Virtual Ethernet Adapter
    AllowComputerToTurnOffDevice : Enabled
    D0PacketCoalescing           : Unsupported
    DeviceSleepOnDisconnect      : Inactive
    ArpOffload                   : Unsupported
    NSOffload                    : Unsupported
    RsnRekeyOffload              : Unsupported
    SelectiveSuspend             : Unsupported
    WakeOnMagicPacket            : Unsupported
    WakeOnPattern                : Unsupported
    Caption                      : MSFT_NetAdapterPowerManagementSettingData 'Oracle VM Virtual Ethernet Adapter'
    Description                  : Oracle VM Virtual Ethernet Adapter
    ElementName                  : Oracle VM Virtual Ethernet Adapter
    InstanceID                   : {EB1D230C-9A2E-49F0-A2F1-6E589130F473}
    InterfaceDescription         : Oracle VM Virtual Ethernet Adapter
    Name                         : Ethernet 3
    Source                       : 2
    SystemName                   : WIN-57PI3MQJH74
    OffloadParameters            :
    WakePatterns                 :
    PSComputerName               :
    CimClass                     : ROOT/StandardCimv2:MSFT_NetAdapterPowerManagementSettingData
    CimInstanceProperties        : {Caption, Description, ElementName, InstanceID...}
    CimSystemProperties          : Microsoft.Management.Infrastructure.CimSystemProperties

     


    Wednesday, January 10, 2018 5:40 AM
  • Hi,

    Thanks for sharing your current progress. In this case, I recommend having a try workaround this by editing the registry, the following article for your reference:
    Information about power management setting on a network adapter
    https://support.microsoft.com/en-us/help/2740020/information-about-power-management-setting-on-a-network-adapter

    If you need further help, please feel free to let us know.

    Best Regards,
    Albert

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, January 10, 2018 11:47 AM
  • Hi,

    Just checking in to see if the information provided was helpful.

    Please let us know if you would like further assistance.

    Best Regards,
    Albert

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, January 12, 2018 7:51 AM
  • Hi,

    I'm checking how the issue is going, was your issue resolved?

    And if the replies as above are helpful, we would appreciate you to mark them as answers, and if you resolve it using your own solution, please share your experience and solution here. It will be greatly helpful to others who have the same question.

    Appreciate for your feedback.

    Best Regards,
    Albert

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, January 16, 2018 2:29 AM
  • Yes,actually I used this way firstly, but for our image, after installed pv driver, the driver number of network adpater is not 0001 anymore, following is what I did:

    $(Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\OVMPCI\VIF\4&15dc77f4&0&0" Driver).Driver   ====> get the actual driver number

    {4d36e972-e325-11ce-bfc1-08002be10318}\0011

    Then:New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Class\$key" -Name "PnPCapabilities" -Value 0x00000018 -PropertyType DWORD -Force

    This way works well, but because there is a hard code value required in command (such as 4&15dc77f4&0&0), so I want to try the new powershell command to do, but now seems there is no better way to do it.

    PS: Is there anyway to get the value "4&15dc77f4&0&0" under "VIF by powershell command , instead of use a hardcode ?

    Anyway, Thanks a lot for you support.

    Wednesday, January 24, 2018 2:54 AM
  • Hi,

    >> PS: Is there anyway to get the value "4&15dc77f4&0&0" under "VIF by powershell command , instead of use a hardcode ?
    You can have a try with the following command:
    Get-ChildItem HKLM:\SYSTEM\CurrentControlSet\Enum\OVMPCI\VIF | Select-Object PSChildName

    Also, Good to hear that you have solved this issue by yourself. In addition, thanks for sharing your solution in the forum as it would be helpful to anyone who encounters similar issues.

    If there is anything else we can do for you, please feel free to post in the forum.

    Best Regards,
    Albert

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, January 24, 2018 9:10 AM