#64891 - 2002-04-25 06:40 PM
bypass servers script help
|
chuckles
Fresh Scripter
Registered: 2001-12-07
Posts: 27
Loc: new york
|
Hi, below is my script that i need some help. I'm trying to make a list of all servers that if it matches one of these servers then GO TO the end (:nothing)
seems if i do: if @wksta = "server1" this works ok..but i need to make a list of servers. any help is appreciated THANKS!
$bypass="'server1' 'server2' 'server3'"
If @wksta = "$bypass" Gosub nothing Else Gosub addmaps Gosub schtask
|
|
Top
|
|
|
|
#64893 - 2002-04-25 07:03 PM
Re: bypass servers script help
|
chuckles
Fresh Scripter
Registered: 2001-12-07
Posts: 27
Loc: new york
|
Thanks for trying to help. Actually i'm not trying to do a OS CHECK. It is more of a COMPUTERNAME Check thats why i'm using @WKSTA. Need a way to add a list of servernames and compare that.
btw i am using 4.02
Thanks!
|
|
Top
|
|
|
|
#64894 - 2002-04-25 07:07 PM
Re: bypass servers script help
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Chuckles, are you saying that you want to run the script on some servers but not others? [ 25 April 2002, 19:07: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#64895 - 2002-04-25 07:27 PM
Re: bypass servers script help
|
chuckles
Fresh Scripter
Registered: 2001-12-07
Posts: 27
Loc: new york
|
yup basically if i use myloginname: charles it will execute my loginscript on ANY MACHINES. What happens is if i login to one of my SERVERS it will execute the SAME loginscript. so to remedy the problem i add if statement that if @WKSTA = "server1" then goto end this will bypass the loginscript. this works fine with one server "server1" but i need to make a LIST of servers that if it belongs to this list then GOTO END.
so i need something like this $bypasslist = "'servertest', 'server2test', 'test3'" If @WKSTA = "$bypasslist" gosub END
|
|
Top
|
|
|
|
#64896 - 2002-04-25 07:33 PM
Re: bypass servers script help
|
Jake
Fresh Scripter
Registered: 2001-11-14
Posts: 26
|
you can do it like this: code:
If @wksta="name1" OR @wksta="name2" goto end else "do whatever" endif
|
|
Top
|
|
|
|
#64897 - 2002-04-25 07:41 PM
Re: bypass servers script help
|
cmarti
Hey THIS is FUN
Registered: 2001-02-26
Posts: 297
Loc: Little Rock, AR
|
You can copy a check file to the %windir% directory on your servers you want in this list (Ex. C:\winnt\checkfile.chk) This is suggested that you only want this to run on servers using 4.0 of kix or higher...
code:
IF INSTR("@PRODUCTTYPE","Server") <> 0 or INSTR("@PRODUCTTYPE","Controller") <> 0 SELECT CASE @USERID <> "Charles" and EXIST("%WINDIR%\CHECKFILE.CHK") = 0 RUN LOGONSCRIPT FOR CHARLES CASE @USERID <> "Charles" and EXIST("%WINDIR%\CHECKFILE.CHK") = 1 GOTO THEEND CASE EXIST("%WINDIR%\CHECKFILE.CHK") = 1 GOTO THEEND CASE EXIST("%WINDIR%\CHECKFILE.CHK") = 0 RUN REGULAR LOGON SCRIPT CASE 1 ENDSELECT ENDIF
....
:THEEND
L8tr...
|
|
Top
|
|
|
|
#64898 - 2002-04-25 07:53 PM
Re: bypass servers script help
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
The idea of a file to check works well.. But...
Where I work, noone logs onto servers as anything but administrator of a domain or of a machine. ALL other work is done on workstations (especially browsing the internet, word processing apps, email, etc.) Using this policy keeps our servers free from excessive junk files and security problems (see Microsoft's frequent security bulletins).
A simple rule: Unless the task is a direct operation on server functions, it probably shouldn't be done at a server console.
Brian
|
|
Top
|
|
|
|
#64904 - 2002-04-27 12:18 AM
Re: bypass servers script help
|
jprompt
Lurker
Registered: 2002-04-26
Posts: 2
Loc: paris
|
$Srvlist = "'server01' 'server02' 'server03'" IF InStrRev( $Srvlist , @WKSTA ) ? "Vous êtes sur un serveur" ENDIF
|
|
Top
|
|
|
|
#64905 - 2002-04-28 03:28 PM
Re: bypass servers script help
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
With the clear and fast solution there is only a problem when workstattion names are f.e. server01 & server011. To solve this we suggest following code
code:
$srvlist="-server01-server011-server02-server022-" IF (Instr($srvlist,"-"+@wksta+"-") <> 0) GOTO next ELSE GOSUB addmaps GOSUB schtask ENDIF :next
Above code works for kixtart 3.x and 4.x releases. greetings.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|