Jump to content

wegpages for controlling room internet access in isa 2004


Recommended Posts

Posted

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.

 

<%
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 "" & blag.name & "
"
   else   
      Response.write "" & 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



%>



<br />
<!--<br />
.style6 {<br />
	font-size: 36px;<br />
	font-family: Arial, Helvetica, sans-serif;<br />
	color: #003300;<br />
	font-weight: bold;<br />
}<br />
.style7 {font-family: Arial, Helvetica, sans-serif}<br />
--><br />


Internet Room Management 

Ticked = Internet allowed in that room

</pre><form action="process.asp" method="get">
 


   
  <% controlcomputers %>
 
 
 


 


   

</for

 

 

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.

 


<%
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 





%>


<br />
<!--<br />
.style6 {<br />
	font-size: 36px;<br />
	font-family: Arial, Helvetica, sans-serif;<br />
	color: #003300;<br />
	font-weight: bold;<br />
}<br />
.style7 {font-family: Arial, Helvetica, sans-serif}<br />
--><br />


Internet Room Management Processed

Ticked = Internet allowed in that room




<% processform %>


Posted

also i have a scheduled vbs script that removes all the computer sets from the pupil rule at the end of lessons and after lunch

 

 

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 = pupilrule.SourceSelectionIPs.ComputerSets

for each blag in computersets
  wscript.echo blag.Name
  pupilrule.SourceSelectionIPs.computersets.removespecified blag.Name
next  

pupilrule.save
CheckError

wscript.echo "Done!"

end sub

sub CheckError()

if Err.Number <> 0  then
   wscript.echo "An error occurred: 0x" & hex(err.number) & " " & err.Description
   err.clear
end if

end sub

controlcomputers

  • 5 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...