[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 848
  • Last Modified:

Wake on LAN using IP Address

I'm using a Powershell script that sends a magic packet to wake a pc that's turned of. It sends the magic packet based on MAC address.

Is there a script, or a way, to send a magic packet based on IP address instead of MAC address?
0
SvenIA
Asked:
SvenIA
3 Solutions
 
Gerwin Jansen, EE MVETopic Advisor Commented:
I don't full understand, WOL works with a MAC address, not with IP.

Do you want a script that looks up a MAC address that (currently) belongs to a certain IP address and then send a WOL packet to that MAC address?

<edit>
$hostIp = [System.Net.Dns]::GetHostByName("your_computer_name").AddressList[0].IpAddressToString
$wmi = gwmi -Class Win32_NetworkAdapterConfiguration -ComputerName "your_computer_name"
$mac = ($wmi | where { $_.IpAddress -eq $hostIp }).MACAddress

Open in new window

0
 
Dan CraciunIT ConsultantCommented:
@Gerwin Jansen: will an offline computer respond to the WMI request?
Just asking, cause I never tried it.

@SvenIA: if the computer is powered off, it does not have an IP address. That's why the magic packet is sent to a MAC address.
0
 
David Johnson, CD, MVPOwnerCommented:
a powered o will not respond to anything.  When you set WOL active in the bios the network card is in a low power state only listening for a magic packet sent to its mac address
0
 
SvenIAAuthor Commented:
Thanks guys. I didn't know that WOL only works with MAC addresses. Now I know :) !
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now