Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hello Codeproject,
For a bit of background, I am attempting to setup Wake on lan settings in our corporation. We have approximately 50 hardware configurations, mostly Lenova based. Our primary OS is Windows XP. There are a few setting that need to be changed on each PC. Some of these settings are specific to XP, and a few are driver specific.

Windows XP Settings: (already complete)
- Allow Hibernate

Settings for the driver are:
- Allow to Save Power (already Complete)
- EnablePME - set to "enabled"
- Wake on Lan Type - set to "Magic Packet"

I am in the initial research phase of pushing out the required configuration on each PC. I am looking for a way to determine the physical wired connections on a PC. My goal is to create a report of the known wired connections. Using SCCM I have been able to generate a report of all connections (205 results) but that contains All connections include blue tooth, virtual connection, wireless etc..

So far I have looked at win32_networkadapter, win32_networkadapterconfiguration.

I have also looked at the registry to try and find a lead. I have discovered that all network drive configuration is stored at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}

So far registry entries has not produced anything useful.

Any assistance would be appreciated.


Brett Hamilton
Posted
Updated 4-Oct-11 6:11am
v5

The best way I have found is through a combination of registry Entries.
Get the network connections... This information can also be found straight in the registry at the path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}

Look for any entries with the "Characteristics" = 132

This will give you a list of physical connections both wireless and wired.

Next go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}
Use the 'instanceid's that you found on the physical connections. Under the physical connection's key, you will find the 'MediaSubType' key.
- Wired connections have value 1.
- Wireless will have the value 2.
- I have also observed a few other values... i have been unable to find the definition of this enum.
 
Share this answer
 
Check the following article : Wake On Lan sample for C#[^]

Because WOL packets need the MAC address you will have to save them beforehand in your application (register to be woken up etc.) then send it using the code above.
 
Share this answer
 
Comments
bretthamilton 4-Oct-11 11:34am    
Actually performing the Wake or Hibernate is not an issue. By default not all PC's are configured to accept the WOL Packets.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900