Adaptor-settings

Device Power Management Configuration

This document outlines the PowerShell scripts and recommended Intune deployment method for standardizing power management settings across enterprise devices. The goal is to ensure device availability by disabling power-saving features that can cause connection drops or prevent remote wake-up.


1️⃣ Script: Disable NIC Power Saving

This script ensures that the “Allow the computer to turn off this device to save power” setting is unchecked for all supported physical network adapters (NICs, Wi-Fi). It includes robust error handling to skip adapters that do not support the power management feature, preventing deployment failure.

PowerShell Script (Disable-NICPowerSave.ps1)

PowerShell

PowerShell: Disable NIC Power Saving
# Get all physical network adapters
$PhysicalAdapters = Get-NetAdapter -Physical
Write-Output "--- Starting NIC Power Management Configuration ---"

foreach ($Adapter in $PhysicalAdapters) {
    $AdapterName = $Adapter.Name
    
    # Attempt to retrieve power management settings
    $PowerSettings = Get-NetAdapterPowerManagement -Name $AdapterName -ErrorAction SilentlyContinue

    if ($PowerSettings) {
        Write-Output "Configuring adapter: '$AdapterName'..."
        
        # Uncheck "Allow the computer to turn off this device to save power"
        $PowerSettings.AllowComputerToTurnOffDevice = 'Disabled'
        
        # Apply the changes
        try {
            $PowerSettings | Set-NetAdapterPowerManagement -ErrorAction Stop
            Write-Output "SUCCESS: Power saving disabled for '$AdapterName'."
        } catch {
            Write-Error "ERROR applying settings to '$AdapterName': $($_.Exception.Message)"
        }
    } else {
        Write-Output "SKIP: Adapter '$AdapterName' does not support power management."
    }
}
Write-Output "--- NIC Power Management Configuration Complete ---"

2️⃣ Script: Disable Device Wake Capability

This script manages the “Allow this device to wake the computer” setting by globally disabling the wake capability for devices currently armed to wake the system.

PowerShell Script (Disable-AllDeviceWake.ps1)

PowerShell

PowerShell: Disable All Wake Devices
Write-Output "--- Starting Device Wake Disablement ---"

# Get a list of all devices currently armed to wake the system
$WakeDevices = powercfg /devicequery wake_armed

# Iterate through the list and disable the wake capability
foreach ($Device in $WakeDevices) {
    $DeviceName = $Device.Trim() 

    if ($DeviceName) { 
        # Use powercfg utility to disable the device from waking the computer
        powercfg /devicedisablewake "$DeviceName"
        Write-Output "Disabled wake for: $DeviceName"
    }
}

Write-Output "--- Device Wake Disablement Complete ---"

3️⃣ Intune Deployment Instructions

Since these specific settings are not available in a standard Intune Configuration Profile, we deploy the PowerShell files as Intune Scripts.

Deployment Steps:

  1. Preparation: Save the scripts above (e.g., Disable-NICPowerSave.ps1 and Disable-AllDeviceWake.ps1).
  2. Navigate to Intune: In the Microsoft Intune admin center, go to Devices > Scripts.
  3. Add a Script:
    • Click + Add and select Windows 10/11.
    • Name: Provide a descriptive name (e.g., PS - Disable NIC Power Saving).
  4. Script Settings:
    • Script Location: Upload the saved .ps1 file.
    • Run this script using the logged-on credentials: Select No. (This ensures the script runs with System/Administrator privileges, which are required to change these settings.)
    • Enforce script signature check: Select No (unless your organization requires script signing).
  5. Assignments: Assign the script to the appropriate device groups that require this configuration.

Deployment Notes:

  • Priority: Deploying the NIC Power Save script is generally considered High Priority to maintain network connectivity for remote management and stability.
  • Monitoring: Check the deployment status in Devices > Scripts to ensure the scripts executed successfully on target devices. Review the script output for any errors reported by the Write-Error commands.