#125946 - 2004-08-31 10:50 PM
HELP - Stopping a certain server from running a script
|
ital_rsx
Lurker
Registered: 2004-08-31
Posts: 4
|
Hi!
I a standard Kixtart script which has a command to run the autopcc.exe file for Trend Virus Scan. How can I block this from running on certain servers?
ie.
if server = server name then do not run .. type thing ** I want all servers to run the following command below EXCEPT for certain servers
use o: "\\ychs2kmanage\officescan"
shell "o:\pccsrv\autopcc.exe"
Any help would be greatly appreciated.
Thanks
|
Top
|
|
|
|
#125947 - 2004-08-31 11:30 PM
Re: HELP - Stopping a certain server from running a script
|
ShaneEP
MM club member
Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
|
You mean something like this...?
Code:
If @WkSta <> "MachineNameYouDontWantItToRunOn" and @WkSta <> "AnotherMachineNameYouDontWantItToRunOn"
use o: "\\ychs2kmanage\officescan"
shell "o:\pccsrv\autopcc.exe"
Endif
Please review the manual that comes with the kix download. It contains all of the info you would have needed to accomplish such a simple task. In particular the Macros and If/EndIf sections.
|
Top
|
|
|
|
#125948 - 2004-09-01 12:02 AM
Re: HELP - Stopping a certain server from running a script
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Hello Ital_rsx and Welcome to the board.
Well for a simple one with just one or two machines then CitrixMan's code would suffice. If you have more then a few machines then you might want to look at doing something like this, OR reading from an .INI file for a list of computers to ignore.
Code:
$SystemList = Split("server1|server2|server3|server4","|") If AScan ($SystemList, @WKSTA)>=0 ;Do nothing Else Use o: /Delete /Persistent use o: "\\ychs2kmanage\officescan" shell "o:\pccsrv\autopcc.exe" EndIf
|
Top
|
|
|
|
#125950 - 2004-09-01 06:25 AM
Re: HELP - Stopping a certain server from running a script
|
Anonymous
Anonymous
Unregistered
|
Thanks NTDOC.
I addded this to my script and it runs with no errors.
However when I log onto the server in question the autopcc.exe shell still attempts to run.
I understand the AScan function which will scan the systemlist array which then uses @WKSTA as the expression.
Am I missing something else?
Does the command WKSTA not work for Windows 2000 Adavanced Server (Citrix Metaframe) and just run through it but not recognize it?
Thanks
|
Top
|
|
|
|
#125953 - 2004-09-01 08:31 PM
Re: HELP - Stopping a certain server from running a script
|
ital_rsx
Lurker
Registered: 2004-08-31
Posts: 4
|
This is the code that I have in the script to do the following:
$SystemList = Split("ych-ctrx1|ych-ctrx2|ych-ctrx3","|") If AScan ($SystemList, @WKSTA)>=0 ;Do nothingElse Use o: /Delete /Persistent use o: "\\ychs2kmanage\officescan" shell "o:\pccsrv\autopcc.exe" EndIf
Thanks
|
Top
|
|
|
|
#125957 - 2004-09-01 11:46 PM
Re: HELP - Stopping a certain server from running a script
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11623
Loc: CA
|
Less typing and looks cooler
But Les is correct, the Split method is not required.
|
Top
|
|
|
|
#125958 - 2004-09-02 03:46 AM
Re: HELP - Stopping a certain server from running a script
|
ital_rsx
Lurker
Registered: 2004-08-31
Posts: 4
|
Thanks Guys
It works great.
|
Top
|
|
|
|
#125959 - 2004-10-11 11:33 PM
Re: HELP - Stopping a certain server from running
|
puck5151
Fresh Scripter
Registered: 2002-05-08
Posts: 11
|
Hi, I'm attempting the same thing but it appears the script continues to run on the excluded server...
;terminal server test for tiwsmgr.exe
$SystemList = 'terminalserver'
If AScan ($SystemList, @WKSTA)>=0
;Do nothing
Else
RUN "\\server\tiwsmgr.exe"
EndIf
Any assistance would be greatly appreciated. Thank you.
Edited by puck5151 (2004-10-11 11:35 PM)
|
Top
|
|
|
|
#125961 - 2004-10-12 03:43 PM
Re: HELP - Stopping a certain server from running
|
puck5151
Fresh Scripter
Registered: 2002-05-08
Posts: 11
|
That worked perfectly! Thanks Bryce.
|
Top
|
|
|
|
#125962 - 2004-10-15 03:30 PM
Re: HELP - Stopping a certain server from running
|
puck5151
Fresh Scripter
Registered: 2002-05-08
Posts: 11
|
Hi Bryce, one more question. Is there a way to only run the script if the server name is in the system list? I would assume changing the end of the ascan from a 0 to a 1 would do the trick but not certain if this is correct.
If AScan ($SystemList, @WKSTA)>=1
|
Top
|
|
|
|
#125963 - 2004-10-15 05:37 PM
Re: HELP - Stopping a certain server from running
|
Anonymous
Anonymous
Unregistered
|
Ok, I figured this one out. I just changed the variable at the end of the command...
FROM: If AScan ($SystemList, @WKSTA)>=0
TO: If AScan ($SystemList, @WKSTA)<>0
|
Top
|
|
|
|
#125964 - 2004-10-15 05:38 PM
Re: HELP - Stopping a certain server from running
|
ShaneEP
MM club member
Registered: 2002-11-29
Posts: 2125
Loc: Tulsa, OK
|
Code:
;terminal server test for tiwsmgr.exe $SystemList = 'terminalserver','' If AScan ($SystemList, @WKSTA)>=0 RUN "\\server\tiwsmgr.exe" EndIf
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
2 registered
(morganw, mole)
and 414 anonymous users online.
|
|
|