• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Query DHCP via ASP

LeetestUnleet

Senior member
I'm putting together a Wake-On-LAN Intranet tool for my company, and I've got the Wake-On-LAN portion working when I pass it a direct hard-coded MAC address and Subnet Mask.

However, the User will be inputting their computer's hostname into a textfield to turn it on remotely. I need to take that hostname and query it against the DHCP server to return the MAC Address.

The servers are running Windows 2003 Server with IIS (using ASP).

Any thoughts?
 
If you're using MS SQL server as your backend the following might work to grab the mac address

CREATE PROCEDURE getMacAddress
@MacAddress varchar(30) OUT
AS
SELECT @MacAddress = net_address FROM master..sysprocesses WHERE spid = @@SPID
RETURN 0
GO

then reference

DECLARE @macaddress varchar(30)
EXEC getmacaddress @macaddress OUT

In an insert trigger. and update the macaddress field in the table with @macaddress for the host just inserted.

Edit: this assumes that they're inputting it from their pc. 😉
 
Back
Top