Already a NinjaOne customer? Log in to view more guides and the latest updates.

Wake-on-LAN Automation

reviewed by Ian Crego

Wake-on-LAN (WoL) is a network technology that enables IT teams to remotely power on computers by sending a specially crafted data packet—called a Magic Packet—to a device’s network adapter. As long as the endpoint is connected to power and properly configured at both the BIOS/UEFI and operating system level, the network interface remains in a low power listening state and can trigger the system to boot when the Magic Packet is received. This allows devices that are powered off or sleeping to become reachable without requiring physical access.

Automating Wake-on-LAN (often through Wake-on-LAN software) increases operational flexibility and efficiency. Organizations can schedule wake events for overnight patching, maintenance, reporting, or remote access, ensuring IT tasks execute when users are not present, minimizing impact. Automated WoL also supports energy-saving goals by allowing devices to remain powered off when idle yet still be brought online on demand. This reduces manual effort, minimizes disruption, and helps maintain compliance and readiness across distributed fleets.

Within NinjaOne, WoL can be initiated directly from the management console, allowing technicians to bring devices online as needed for troubleshooting or maintenance. This provides a centralized, convenient way to ensure endpoints are available when required without relying on users to power on their devices.

What is a WoL magic packet?

A WoL magic packet is an Ethernet broadcast network packet designed to wake sleeping computers.

It consists of six bytes of FF, followed by the target device´s MAC address sixteen times:

FF FF FF FF FF FF

<MAC> <MAC> <MAC> … (16 times)

Can any computer be powered on via WoL?

No, there are some hardware requirements and specific configurations that must be enabled at both the BIOS and OS levels:

BIOS level:

  • The motherboard and NIC must support Wake-on-LAN (WoL)
  • WoL must be enabled in BIOS/UEFI settings.
  • ACPI power state support (typically S3/S4/S5) must allow wake events.
  • “ERP/Low-Power mode” settings may need to be disabled so the NIC can stay powered while the system is off.

Note: Setting names vary widely among OEM but the goal is to ensure the NIC remains powered and allowed to trigger system power-up.

OS level:

  • A compatible network driver must be installed with WoL / Magic Packet support enabled.
  • NIC power-management settings must allow the device to wake the system (e.g., “Allow this device to wake the computer”).

Can NinjaOne natively power on a computer via WoL?

Yes. NinjaOne can send a Wake-on-LAN magic packet; however, the endpoint will only power on if it is properly configured for WoL. The magic packet is relayed through another NinjaOne-managed device in the same subnet, so at least one powered-on device must be present in that subnet.

These are the requirements for using Wake-on-LAN with NinjaOne:

  • Both the sleeping device and the device sending the wake request must be managed by NinjaOne.
  • The sleeping device must be connected to the network via a wired Ethernet connection.
  • The sleeping device and the device sending the wake request must:
    • Belong to the same organization.
    • Reside on the same subnet and share the same gateway IP.
    • Be Windows devices.

Follow the steps below to send a Wake-on-LAN magic packet to an endpoint.

  1. Select the sleeping device and open the device dashboard.

Device dashboard

  1. Click the run icon ( ).
  2. Select Wake on Lan.

How can I wake up a group of devices in bulk?

To send a Wake-on-LAN magic packet to a group of computers, follow the steps below:

  1. Click Devices on the left navigation pane within the NinjaOne console. Alternatively, you can load a predefined group.
  2. Select the devices you want to wake by checking the box to the left of each device name. You can use the filters to narrow down the list.
  3. Click Run.
  4. Select Wake on Lan.

Can I schedule waking up one or more devices?

Yes. You can do this using a remote scheduled task. NinjaOne does not include a built-in WoL script for automation, so you must provide your own script.

For better understanding, let´s illustrate this with one example. In this example we will create a remote scheduled task named “Wake up computers”, it will run every Tuesday at 11 PM. The automation (PowerShell script) broadcasts WoL magic packets based on a list of MAC address provided as a parameter.

Follow the steps below to create this scheduled.

  1. From the NinjaOne main console, navigate to Administration > Library > Automation.

NinjaOne main console

  1. Click + Add Automation. From the drop-down, select New script. The “Create Script” screen will appear.

“Create Script” screen

  1. Fill in the Name and Description (for this example, the name will be “Wake up endpoints”).
  2. In Categories, select “Maintenance”.
  3. In Language, select “PowerShell”.
  4. In Operating System, select “Windows”.
  5. In Architecture, select “64-bit”.
  6. In Run As, select “System”.
  7. Leave the following fields blank.
  8. Copy the following script* to the black script window:

# Wake-on-LAN sender

param(

[string]$macList

)

# Expect: "AA:BB:CC:DD:EE:FF-11:22:33:44:55:66-..."

# Split outer list by hyphen, drop blanks

$macs = ($macList -split '-') | Where-Object { $_ -and $_.Trim() -ne '' }

# Strict colon-separated MAC: 6 hex octets (e.g., B1:B2:B3:B4:B5:B6)

$macRegex = '^(?:[0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$'

$valid = @()

$invalid = @()

foreach ($m in $macs) {

$t = $m.Trim()

if ($t -match $macRegex) { $valid += $t.ToUpper() } else { $invalid += $t }

}

if ($invalid.Count -gt 0) {

Write-Host "Invalid MAC address format (expected XX:XX:XX:XX:XX:XX):"

$invalid | ForEach-Object { Write-Host " - $_" }

}

if ($valid.Count -eq 0) {

Write-Host "No valid MAC addresses provided. Aborting."

exit 1

}

Write-Host "Sending WoL magic packet to:"

$valid | ForEach-Object { Write-Host " - $_" }

# Prepare UDP broadcast to port 9

$udp = New-Object System.Net.Sockets.UdpClient

$udp.EnableBroadcast = $true

$endpoint = New-Object System.Net.IPEndPoint([System.Net.IPAddress]::Broadcast, 9)

foreach ($mac in $valid) {

# Convert "AA:BB:CC:DD:EE:FF" to bytes

$macBytes = ($mac -split ':') | ForEach-Object { [Convert]::ToByte($_,16) }

# Build magic packet: 6 x 0xFF + MAC repeated 16 times

$packet = New-Object System.Collections.Generic.List[byte]

1..6 | ForEach-Object { [void]$packet.Add(0xFF) }

1..16 | ForEach-Object { [void]$packet.AddRange($macBytes) }

# Send packet

[void]$udp.Send($packet.ToArray(), $packet.Count, $endpoint)

}

$udp.Close()

* This PowerShell script broadcasts a Wake-on-LAN (WoL) magic packet for each MAC addres provided. The script reads the MAC address list from the command line, which is passed as a preset parameter by NinjaOne.

You may specify one or multiple MAC addresses. When providing more than one, they must be separated by a hyphen (-), and the entire MAC address list must be enclosed in quotes. Each MAC address must follow this format:

B1:B2:B3:B4:B5:B6

You can include as many MAC addresses as needed.

  1. Click Save (you may need to enter your MFA response).
  2. Navigate to Administration > Tasks.
  3. Click + Create task. The task editor appears.
  4. Fill out the task name and description. Uncheck the Allow Groups option.
  5. Enter a schedule (for this example, Tuesdays 11 PM local time was selected).

Enter a schedule screen

  1. Click Add on the right. The automation library appears.
  2. Find and click on the desired automation, “Wake up endpoints” for this example. You can use the filters or the search option to make your search easier.
  3. Select the account that will run this script and preset parameters; for this example, enter your MAC address in the preset parameter.

Run script and preset parameters

  1. Click Apply. The Automation library closes, and the selected automation appears on the new scheduled task.
  2. Click Targets on the left side menu.
  3. Click Add, to add a target device. This is the device that will run the script.

Add a target device

  1. Click the first row, where it says “Organization” and select Device (Windows, Mac, Linux). A list of all devices appears.
  2. Select a Windows device (other than the computer you want to wake up) that will remain powered on when the task runs, and it´s located on the same subnet as the computer you want to wake up. This is the device from which the script will be executed. You can use the search option to make the search easier.
  3. Click Apply.
  4. Click Save (You may need to enter your MFA response.)
  5. Click Close.
  6. The new scheduled task named Wake up computers appears listed in the task screen.

Disclaimer:
The sample script provided is intentionally minimal and contains a very basic input validation. It has no error handling, or security safeguards. It is intended for educational and demonstration purposes only. This script should not be used in production environments. Use it at your own risk, and ensure appropriate testing, security controls, and validation before deploying any automation in a live system.

FAQ

WoL automation in NinjaOne can be configured by using NinjaOne´s Remote Task scheduler.

You can schedule a task with an automation to wake up one computer, a group of computers, or build a more complex automation to wake up the computers, perform some task(s), and maybe turn them back off.

Ensure the NIC remains powered and allowed to trigger system power-up.

To enable Wake-on-LAN, the following must be configured:

BIOS/UEFI

  • Enable Wake-on-LAN / Wake from PCI-E.
  • Ensure the NIC remains powered during shutdown (disable deep-sleep options).

Operating System / NIC

  • In the NIC properties, allow the device to wake the computer.
  • Enable “Wake on Magic Packet.”

Network

  • Device must be on a powered Ethernet connection.
  • Magic Packet must be allowed to reach the endpoint (typically UDP 7 or 9).

In most environments, WoL across subnets/VLANs is not enabled by default and requires coordination with network teams to ensure security and routing are handled properly. By default, Wake-on-LAN works only within the same subnet because the magic packet is typically sent as a broadcast, which routers do not forward.

To make it work across different subnets or VLANs, network administrators must explicitly enable support—for example, by configuring directed broadcasts, relay mechanisms, or WoL-capable gateways.

For the reason explained above, a standard magic packet doesn´t cross VPN tunnels by default. Some VPN/remote-access solutions can support WoL, but only if they provide a mechanism such as: Directed broadcast support, A WoL relay component or a remote agent on the LAN that sends the packet locally. Without one of these, WoL traffic sent over VPN will not reach the sleeping device.

You can directly use the “Wake on Lan” option explained in this document under “Can NinjaOne natively power on a computer via WoL?”.

You can also use third-party wake-on-LAN software for Windows, like WakeMeOnLan by NirSoft, to verify that a device is correctly configured.

Yes, this can be achieved using NinjaOne´s remote task scheduler and a script that sends the WoL magic packets to the target devices.

Any device that supports WoL can take advantage of Wake-on-LAN automation.

Here are some suggested troubleshooting steps in case WoL fails.

  1. Confirm WoL is enabled in the BIOS/UEFI.
    Look for options such as Wake-on-LAN, Power On by PCI-E, or similar.
  2. Confirm WoL is enabled in the operating system.
    In Windows, verify the network adapter’s advanced properties and power-management settings.
  3. Verify network placement.
    Ensure that both the device sending the magic packet and the target device are on the same Layer-2 subnet/VLAN, unless your network is specifically configured to relay WoL broadcasts.
  4. Check that broadcast traffic is allowed.
    WoL requires broadcast (or directed-broadcast) packets. Switch/firewall policies must allow this.
  5. Confirm the device still has link in sleep mode.
    The NIC must remain powered when the system is asleep; look for a link light on the switch port.
  6. Verify the correct MAC address is used.
    The magic packet must match the target device’s NIC MAC.
  7. Check switch configuration.
    Some managed switches block broadcast forwarding or WoL-related traffic; adjust as needed.

Most systems do not support WoL over Wi-Fi because wireless chipsets and drivers typically cannot remain powered and associated to the access point while the system is asleep. As a result, they cannot receive the magic packet.

Some vendors advertise “WoWLAN,” but support is limited, model-specific, and often unreliable. For most practical scenarios, assume WoL works only over wired Ethernet.