this works if you have computer sets for rooms. (need static ip addresses this to work)
been making these for a while. just got them working. to combat lost time from taking phone calls to turn the internet on/off. The idea being the teachers do it themselves. You have to give them admin rights on the isa server. Not an ideal solution but as long as they dont go near the actual pc will be fine.
NB: this applies to a rule called pupil access which only applies to individuals (pupils) which have restricted access.
index.asp
enumerates the names of all the possible computer sets into a form. if len(blag.name) < 6 then excludes the builtin sets. anything you dont want appearing on the form you can just make the name longer than 6 chars.
Any set currently set to 'on' has a ticked box.
Code:<% sub controlcomputers() dim root set root = CreateObject("FPC.Root") dim array dim policyrules dim computersets dim pupilrule set array = root.GetContainingArray set policyrules = array.ArrayPolicy.PolicyRules set pupilrule = policyrules.item("Pupil Access") set computersets = array.RuleElements.ComputerSets dim onsets set onsets = pupilrule.SourceSelectionIPs.ComputerSets dim found,tmp for each blag in computersets if len(blag.name) < 6 then found = false 'tmp = if setlookup(blag.name,onsets) then Response.write "<input type='checkbox' name='room' value='" & blag.Name & "' checked>" & blag.name & " " else Response.write "<input type='checkbox' name='room' value='" & blag.Name & "'>" & blag.name & " " end if end if next pupilrule.save CheckError 'wscript.echo "Done!" end sub sub CheckError() if Err.Number <> 0 then Response.write "An error occurred: 0x" & hex(err.number) & " " & err.Description err.clear end if end sub function setlookup(lookupname,lookinto) 'response.write "function start" & lookupname & " " for each item in lookinto if item.name=lookupname then 'response.write item.name & " true " setlookup = true exit function end if 'response.write item.name & " false " next setlookup = false end function %> <style type="text/css"> <!-- .style6 { font-size: 36px; font-family: Arial, Helvetica, sans-serif; color: #003300; font-weight: bold; } .style7 {font-family: Arial, Helvetica, sans-serif} --> </style> <p class="style6">Internet Room Management </p> <hr noshade> <span class="style7">Ticked = Internet allowed in that room </span> <form action="process.asp" method="get"> <% controlcomputers %> </p> </p> <input type="submit" name="Submit" value="Submit"> </p> </form>
process.asp
removes everything and then adds the ticked boxes passed from the previous page.
re-asks what is 'on' and lists the results.
if you have a set that contains pcs that are always 'on' its easier to put it on a separate rule.
Code:<% sub processform() dim root set root = CreateObject("FPC.Root") dim array dim policyrules dim computersets dim pupilrule set array = root.GetContainingArray set policyrules = array.ArrayPolicy.PolicyRules set pupilrule = policyrules.item("Pupil Access") set computersets = pupilrule.SourceSelectionIPs.ComputerSets for each blag in computersets 'response.write blag.Name pupilrule.SourceSelectionIPs.computersets.removespecified blag.Name next for each itemx in request.querystring("room") pupilrule.SourceSelectionIPs.computersets.add itemx, fpcinclude 'response.write itemx next pupilrule.save CheckError response.write "Validating...access allowed at: " for each blagx in computersets response.write blagx.Name & " " next end sub sub CheckError() if Err.Number <> 0 then Response.write "An error occurred: 0x" & hex(err.number) & " " & err.Description err.clear end if end sub %> <style type="text/css"> <!-- .style6 { font-size: 36px; font-family: Arial, Helvetica, sans-serif; color: #003300; font-weight: bold; } .style7 {font-family: Arial, Helvetica, sans-serif} --> </style> <p class="style6">Internet Room Management Processed</p> <hr noshade> <span class="style7">Ticked = Internet allowed in that room </span> <% processform %>



LinkBack URL
About LinkBacks
Reply With Quote






