|
|
|||||||
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 |
||||||||
|
|
|||||||
You mean something like this...? Code:
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. |
||||||||
|
|
|||||||
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","|") |
||||||||
|
|
|||||||
SHane, You cannot use AND in that situation since it is not possible that @WKSTA be BOTH. edit: DUH! forget what I said |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
the code that doc posted works fine for me using @WkSta. perhaps there is a mis-spelling or missing quote or something in yours. maybe re-post the code exactly as you are trying it so we can have a look if you still cant get it working. |
||||||||
|
|
|||||||
Make sure there are no spaces in your code otherwise a blank on the front or end of the list will not match the server name. Shouldn't need it here, but there is a UDF to remove blanks from an array as well, but I'd skip it myself and just make sure the typing is correct. You could also have it show the name of the servers to a DOS console to confirm. WOW - My 4444 post |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
Unless it's a typo, the reason it doesn't work is that you have the "Else" keyword commented out. Code:
|
||||||||
|
|
|||||||
Or to simplify it a bit more you can also do... $SystemList = Split("ych-ctrx1|ych-ctrx2|ych-ctrx3","|") If AScan ($SystemList, @WKSTA)<0 Use o: /Delete /Persistent use o: "\\ychs2kmanage\officescan" shell "o:\pccsrv\autopcc.exe" EndIf |
||||||||
|
|
|||||||
Why even Split() to make an array? $SystemList = 'ych-ctrx1','ych-ctrx2','ych-ctrx3' |
||||||||
|
|
|||||||
Less typing and looks cooler But Les is correct, the Split method is not required. |
||||||||
|
|
|||||||
Thanks Guys It works great. |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
$systemlist is not anarray, so ascan() will not work on it. do this... $SystemList = 'terminalserver','' |
||||||||
|
|
|||||||
That worked perfectly! Thanks Bryce. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
Code:
|
||||||||
|
|
|||||||
if the item is not in the array, it will return -1. thus, simply using: If AScan ($SystemList, @WKSTA)>=0 or: If AScan ($SystemList, @WKSTA)>-1 |
||||||||
|
|
|||||||
He's talking about Citrix Metaframe. The question is now, under which computer account is the script actually running? See the FAQ Forum for help on running scripts in Citrix. |