Solved

IIS Wake On Lan Form

Posted on 2009-04-14
2
2,040 Views
Last Modified: 2012-05-06
Hey,

I found some code on a website for IIS based Wake on Lan.
http://www.depicus.com/wake-on-lan/wake-on-lan-asp.aspx

What I'm looking for basically. Is someway to set it up so that I can have multiple computers prestored in the page OR a sql database, and all the user sees is a drop down box with a list of computer names in Real Name sense, Ie Server1, Client1 etc so they can select that, press a button and it will run the scripts and wake up the selected computer.

Any help appreciated.

Regards

Static Code:
<%
set WakeOnLan = server.createobject("DigitalWol.Wol")
WakeOnLan.TheMacAddress('009027a322fc')
WakeOnLan.TheIpNumber('217.204.255.61')
WakeOnLan.TheSubnetMask('255.255.255.240')
WakeOnLan.ThePortNumber('8900')
WakeOnLan.WakeMeUp
%>
 
 
Form Code:
<form method="post" action="bottom.asp" target="bottom">
<p align="justify" style="margin-left: 10">This is where you would enter the Mac Address.</p>
<input type="text" name="MacAddress" size="20" value="009027a322fc">
<input type="text" name="IpNumber" size="20" value="195.188.159.20">
<input type="text" name="SubnetMask" size="20" value="255.255.255.0">
<input type="submit" value="Send Magic Packet" name="thebutton" class="button">
</form>
 
<%
if Request.Form("MacAddress") <> "" then
set WakeOnLan = server.createobject("DigitalWol.Wol")
WakeOnLan.TheMacAddress(Request.Form("MacAddress"))
WakeOnLan.TheIpNumber(Request.Form("IpNumber"))
WakeOnLan.TheSubnetMask(Request.Form("SubnetMask"))
WakeOnLan.ThePortNumber(Request.Form("PortNumber"))
WakeOnLan.WakeMeUp
end if
%>

Open in new window

0
Comment
Question by:Aegil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
JoachimMartinsen earned 500 total points
ID: 24182673
To do this without database:
<%
'myServers = a string containing all servers. values seperated by colon, and servers seperated by semi-colons
myServers = myServers & "Server 1:009027a322fc:195.188.159.20:255.255.255.0:8900;"
myServers = myServers & "Server 2:009027a322fc:195.188.159.20:255.255.255.0:8900;"
myServers = myServers & "Server 3:009027a322fc:195.188.159.20:255.255.255.0:8900;"
 
if len(request.form("server"))>0 then
	on error resume next ' enable error cathing
	arrValues = split(request.form("server"),":")
	set WakeOnLan = server.createobject("DigitalWol.Wol")
	WakeOnLan.TheMacAddress(arrValues(1))
	WakeOnLan.TheIpNumber(arrValues(2))
	WakeOnLan.TheSubnetMask(arrValues(3))
	WakeOnLan.ThePortNumber(arrValues(4))
	WakeOnLan.WakeMeUp
	set WakeOnLan = nothing
	if err<>0 then
		response.write "An error occured. Please try again."
	else
		response.write "Success. Wake Up Call sent to server."
	end if
	on error goto 0 ' disable error cathing
else
	arrServers = split(myServers,";")
	response.write "<form method=""post"" action=""""><select name=""server"">"
	for x = 0 to ubound(arrServers)
		if len(arrServers(x))>0 then
			arrValues = split(arrServers(x),":")
			serverName = arrValues(0)
			response.write "<option value="""&arrServers(x)&""">"&serverName&"</option>"
		end if
	next
	response.write "</select><button type=""submit"">Wake Up</button></form>"
end if
%>

Open in new window

0
 
LVL 5

Expert Comment

by:ts4673
ID: 34427100
take a look at poweronmypc.com
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Setting up a IIS 8 Web Server to send and receive XML files 7 125
Insert Button on a table 16 55
ASP Classic Query that needs to display more information 18 49
SQL help please 15 35
First of all, clustering IIS is something you should rarely consider doing. In almost all cases, Microsoft Network Load Balancing (NLB) (http://technet.microsoft.com/en-us/library/cc758834(WS.10).aspx) is a much better solution when you need to p…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question