#133155 - 2005-01-31 12:36 PM
Running a remote kix script
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Hi all,
Can any body tell me a way of running a kix script on a remote machine? In order that it executes commands on that machine? Is this possible?
Ie User 1 connects to \\computer1\c$ runs scipt that executes kix commands on \\computer1....
Is this poss via script?
Regards
Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
#133157 - 2005-01-31 01:39 PM
Re: Running a remote kix script
|
Anonymous
Anonymous
Unregistered
|
Richard,
Thanks for the reply, I have found a UDF ONEAWEEK() but this does not meet my needs as I need to be able to run a script remotely in real time. This will be done manually and not during logon. And will need to be runs several times a day..
Steve.
|
Top
|
|
|
|
#133159 - 2005-01-31 02:19 PM
Re: Running a remote kix script
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
What's wrong with RemoteExec()?
|
Top
|
|
|
|
#133161 - 2005-01-31 02:57 PM
Re: Running a remote kix script
|
Anonymous
Anonymous
Unregistered
|
Hi Jochen,
I have already scripted a rather primative system that allows my Teachers to disable/enable the Internet via a simple form. The form just copies (for disable) deletes (for enable) a 0 kb file onto the netlogon shares. I then have a second script (runs after logon) that looks for file and if exists overwrites 'proxyserver' HKCU key with "", so when users try to run their Iexplore icon, (actually a kix script that checks state of proxyserver) they get a message 'your internet is disabled'.
I wanted to extend this further by allowing teachers to disable invidual machines, I thought perhaps I would create a form that listens for input (computer name variable) then goes off and runs a script on that remote machine, and over writes 'proxyserver'.
Steve.
|
Top
|
|
|
|
#133162 - 2005-01-31 03:13 PM
Re: Running a remote kix script
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
I have tried to use the UDF in the following way, but get the error. 'Failed to find open script' when I get to this part of the script, Code:
$Connect = GetObject('winmgmts:{impersonationLevel=impersonate}!//'+$computer+'/root/cimv2:Win32_Process')
The following is what im using to test. Code:
FUNCTION RemoteExec($command, optional $computer) dim $Connect, $Process if not $computer $computer='.' endif if instr($computer,'\') $computer=substr($computer,instrrev($computer,'\')+1) endif $Connect = GetObject('winmgmts:{impersonationLevel=impersonate}!//'+$computer+'/root/cimv2:Win32_Process') $Process = $Connect.Create($Command) exit @error ENDFUNCTION
RemoteExec('kix32 c:\windows\hiddrv.kix', $ITadmin)
Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
#133165 - 2005-01-31 04:21 PM
Re: Running a remote kix script
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Tried the following as per Richards suggestion.. Code:
RemoteExec('%windir%\kix32 c:\%windir%\hiddrv.kix', $ITadmin)
Im still getting 'failed to find/open script' It is running the script though (im using /d).
Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
#133166 - 2005-01-31 04:23 PM
Re: Running a remote kix script
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
But hey if you can recommend any software that allows you to disable internet access by room/computer/session then Ill certainly look at it. Does websense do this?
Yes.
Quote:
PS I work in a school... MONEY IS REALLY TIGHT
Whoa, no need to shout, I ain't deaf yet.
Websense is very expensive, and very complicated so it may not suit you.
Doesn't your local education authority have guidelines or best practices for providing internet access to pupils? I would have thought that would be the best place to look for direction. You should certainly ensure that you are complying with any minimum level of monitoring and control of access.
What you've got now may suit your needs but kids are often surprisingly devious and tricky and the only way to ensure that they cannot bypass the security is to take access control away from the client and manage it on the router / firewall / proxy.
The cheapest solution is to use a proxy, and only allow the proxy computer to access the Internet directly. You then manage client access on the proxy. This works very well in most situations. It only falls down when you need to provide access to protocols which are not supported by the proxy.
|
Top
|
|
|
|
#133168 - 2005-01-31 04:37 PM
Re: Running a remote kix script
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
RemoteExec('%windir%\kix32 %windir%\hiddrv.kix', $ITadmin)
however, the vars will be evaluated before it is sent
so copy $folder+'\kix32.exe' $itadmin+'\c$$\temp' copy $folder+'\hiddrv.kix' $itadmin+'\c$$\temp' RemoteExec('c:\temp\kix32 c:\temp\hiddrv.kix', $ITadmin)
|
Top
|
|
|
|
#133169 - 2005-01-31 05:02 PM
Re: Running a remote kix script
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Richard thanks for reply,
Im afraid a proxy isnt the solution, we do have a proxy server what is controlled off site. And we do have a facility to monitor what content pupils have accessed and we do have sanctions and we can and do take internet access away from individuals. The common problems in a school are not just filtering.
You see pupils will open a browser while they should be working in word. They do minimise said browser when Teacher walks past. Pupils will bully others into giving password details (for net access) so sometimes it is hard to sort out the 'wrong doers'. Teacher will want to have internet on sometimes for all a lesson, only half a lesson or last ten minutes of lesson. So taking away individuals access is not an option. For ICT to control this is not an option.
We need a solution that:
We can select either a group of users (a class) or a group of machines (my system does the later) and enables/disables net access.
The teacher needs to control this from their workstation.
Teachers dont need to cut just certain sites out, they need to stop pupils from browsing altogether.
But this has to be done room to room class to class session to session.
Imperata (sanako) was supposed to do this, execept pupils can type a url into word, my computer etc and access internet.
So, the solution ive got may not be ideal and if you want ill post it on the board and you could pick holes in it(it is primative I warn you) but it works. I want the teacher from a form that I write to click a button (after selecting %computername%) and a script run on remote machine that turns off internet access. I could use the Kill udf for closing browsers! (v. useful!).
I hope this explains a schools predicament to you.
I had a quick look at Websense and your right, its not for the school. We can filter/block etc anyway and even produce reports to show what the pupils have been accessing..
Regards
Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
#133172 - 2005-02-01 09:29 AM
Re: Running a remote kix script
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
Im afraid a proxy isnt the solution
Don't be too quick to disregard it.
The simple solution is to (ask) for the the external proxy that you do not manage to only accept connections from a single IP address. Assign this IP address to an internal proxy server which is under your control.
You now control which users / machines can access the Internet. Either provide the teachers with access to the proxy configuration to allow them to turn rule sets on and off, or configure time-of-day rules to do it automatically if the time-table is sufficiently structured.
|
Top
|
|
|
|
#133173 - 2005-02-01 12:49 PM
Re: Running a remote kix script
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Hi,
Ive tried using the suggestions made but nothing seems to work. Im assuming that I am using the UDF correctly and replacing $computer in the example with $'mycomputer'. Do I need to install anything else? Code:
FUNCTION RemoteExec($command, optional $computer) dim $Connect, $Process if not $computer $computer='.' endif if instr($computer,'\') $computer=substr($computer,instrrev($computer,'\')+1) endif $Connect = GetObject('winmgmts:{impersonationLevel=impersonate}!//'+$computer+'/root/cimv2:Win32_Process') $Process = $Connect.Create($Command) exit @error ENDFUNCTION
;copy $folder+'\kix32.exe' $serv2k1+'\c$$\temp' ;copy $folder+'\delprof.kix' $serv2k1+'\c$$\temp' ;RemoteExec('c:\temp\kix32 c:\temp\delprof.kix', $serv2k1)
RemoteExec('kix32.exe c:\winnt\delprof.kix', $serv2k1)
Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 692 anonymous users online.
|
|
|