Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 871
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

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