#58117 - 2001-08-09 05:34 PM
Advice for logging roaming users on
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
Hi everyone! Been an abosolute age since i've posted anything on here. I see its still going strong as ever and also getting better. Anyway i'm just after a bit of advice from some of you as you seem to be kinda like all rounders. Here goes. We have several sites throughout the company and each site has a specific script that the users run. This is the logonscript that we run here at Stoke: code:
@ECHO OFF SET SERVER=STOKE REM Verifying / Updating Script Software Installation, Please Wait...IF "%OS%" == "Windows_NT" GOTO WinNT %windir%\command\XCOPY %0\..\KIX\KIX32.EXE %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL %windir%\command\XCOPY %0\..\KIX\KX16.DLL %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL %windir%\command\XCOPY %0\..\KIX\KX32.DLL %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL %windir%\command\XCOPY %0\..\KIX\KX95.DLL %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL REM Loading Logon Script, Please Wait... %windir%\system\kix32.exe \\%server%\sys\programs\logon\loginset.kix CLS GOTO End :WinNT XCOPY %0\..\KIX\KIX32.EXE %WINDIR%\SYSTEM32\ /D /H /I /R /V > NUL XCOPY %0\..\NTUtils\igrant.exe %WINDIR%\SYSTEM32\ /D /H /I /R /V > NUL XCOPY %0\..\NTUtils\rmtshare.exe %WINDIR%\SYSTEM32\ /D /H /I /R /V > NUL REM Loading Logon Script, Please Wait... %WINDIR%\SYSTEM32\KIX32.EXE \\%server%\sys\programs\logon\loginset.kix CLS GOTO end :End EXIT
This is the loginset.kix that is called from the above script. ; Kix32 script to do standard login tasks for Windows CLS code:
USE F: /DELETE USE F: \\%SERVER%\SYS USE P: /DELETE USE P: \\%SERVER%\SYS USE W: /DELETE USE W: \\%SERVER%\SYS USE X: /DELETE USE X: "\\%CDLIBRARY%\CDLIBRARY"IF INGROUP("None TCMS Users") CALL "\\%SERVER%\SYS\PROGRAMS\LOGON\UPDATES.KIX" ELSE CALL "\\%SERVER%\SYS\PROGRAMS\LOGON\UPDATES.KIX" CALL "\\%SERVER%\SYS\PROGRAMS\LOGON\DOWNWIN.KIX" CALL "\\%SERVER%\SYS\PROGRAMS\LOGON\VECBUILDUPDT.KIX" CALL "\\%SERVER%\SYS\PROGRAMS\LOGON\TCMSUPDT.KIX" CALL "\\%SERVER%\SYS\PROGRAMS\LOGON\FIXINI.KIX" ENDIF IF @INWIN=2 SETTIME "\\%SERVER%" SHELL "\\%SERVER%\SYS\PROGRAMS\LOGON\WINSET WIN95=1" SHELL "\\%SERVER%\SYS\PROGRAMS\LOGON\WINSET SERVER=%SERVER%" USE U: /DELETE USE U: "\\%SERVER%\"+@USERID SHELL "\\%SERVER%\SYS\PROGRAMS\LOGON\WINSET LOGNAME="+UCASE(@USERID) SHELL "\\%SERVER%\SYS\PROGRAMS\LOGON\WINSET WPC=/@@U-"+UCASE(@USERID) ELSE SHELL "%COMSPEC% /E:1024 /C NET TIME \\%SERVER% /SET /Y > NUL" $NAME = UCASE(@USERID) SET "LOGNAME=$NAME" $INT = "/@@U-"+UCASE(@USERID) SET "WPC=$INT" ENDIF
The one we use for say our Liverpool office would be identical except for the fact that the server variable would be set to the Liverpool server. Now this works fine for users that do not roam around different offices but the problem arises when we have a user that works from different offices. Say for example Jo Bloggs user is set up in Stoke he runs stokescr.bat which is fine when he is in Stoke as the scripts run at an adequate speed. But if he logs on in Liverpool he still runs the stoke script and connects to the stoke server and pulls any updates from there which can sometimes take ages. Has anybody got any ideas on a away around this? All I want the roaming users to be able to do is when they are in a remote office they just map the drives to their home server but when they are in their home office they run the updates. I hope I have made some sense here and that you can be of some assistance. Any help or suggestions are welcome. I was thinking of using the slownet.exe command that comes with SMS but that just checks the speed of the logon server which is no help to me. Thanks Julian [ 09 August 2001: Message edited by: Julian ]
|
|
Top
|
|
|
|
#58118 - 2001-08-09 05:53 PM
Re: Advice for logging roaming users on
|
Anonymous
Anonymous
Unregistered
|
Why not match the @LSERVER to %server%? IF (%server%=@LSERVER) "do updates" ENDIFAs long as you don't have multiple domain controllers per site... Or even that wouldn't be a problem: code:
SELECT CASE %server%=STOKE IF (@LSERVER=dcstoke1) OR (@LSERVER=dcstoke2) "do updates" ENDIF CASE %server%=LIVERPOOL IF (@LSERVER=dcliverpool1) OR (@LSERVER=dcliverpool2) "do updates" ENDIF ENDSELECT
You get the picture... Oh, and in light of another discussion about the speed of kix scripts maybe you should considder defining $LSERVER=@LSERVER at the beginning of the script since the macro's seem to be slower. This was the finding, wasn't it guys?
|
|
Top
|
|
|
|
#58119 - 2001-08-09 06:13 PM
Re: Advice for logging roaming users on
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
I did kinda think of that but in some sites we have got two logonservers and the clients seem to choose them at random. That would mean having an identical copy of the updates on both servers unless there is another way around that.Cheers Ju
|
|
Top
|
|
|
|
#58120 - 2001-08-10 01:26 PM
Re: Advice for logging roaming users on
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
Arrhhhh!!! I can see how it would work now. Just one other small problem though? Some of our clients in other offices seems intent on using Stoke as their Logonserver. IS there away to force them to use their local server instead of Stokes?
|
|
Top
|
|
|
|
#58122 - 2001-08-16 12:02 AM
Re: Advice for logging roaming users on
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
Hi sorry took so long to get back to you. We have just the one domain iver 14 sites all connected via leased lines. The running the script depending on IP address sounds promosing actually. We also don not run RAS server.Any more input would be greatlt appreciated. Julian
|
|
Top
|
|
|
|
#58123 - 2001-08-16 12:34 AM
Re: Advice for logging roaming users on
|
Anonymous
Anonymous
Unregistered
|
Like a W2000 domain, implement the site-concept. For that you will have to find your IP default gateway, which normally is set in the DHCP-properties.Don't know where to find the default gateway but though.
|
|
Top
|
|
|
|
#58124 - 2001-08-16 12:56 AM
Re: Advice for logging roaming users on
|
test_user
Fresh Scripter
Registered: 2000-02-29
Posts: 14
|
Julian,Maybe you can give this a try... ; **************************************************************************************************************** ; File name : INVENTRY.SCR ; Description : Additional script for invenory of workstations ; Location : ; **************************************************************************************************************** ; Date | Description | Initiator ; ------------+--------------------------------------------------------------------------+------------------------ ; **************************************************************************************************************** :GetIpInfo ; ------------------------------------------------------------------------------------------ ; Get Location by IP ; ------------------------------------------------------------------------------------------
$ipadd0=@IPADDRESS0 $3ebyte = " " $3ebyte = rtrim(ltrim(substr(@IPADDRESS0,9,3))) ; 3rd octet SELECT CASE $3ebyte = "1" Call Stoke.kix GOTO End CASE $3ebyte = "2" Call Lpool.kix GOTO End CASE 1 ENDSELECT :End ; **************************************************************************************************************** ; End of script ; ---------------------------------------------------------------------------------------------------------------- [ 15 August 2001: Message edited by: test_user ]
|
|
Top
|
|
|
|
#58125 - 2001-08-15 02:09 PM
Re: Advice for logging roaming users on
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
How do you mean bergx 'the site cocept'? and can you use KiX to pull the default gateway of a client? If I could do that it shouldnt be a problem or I could also use test_users apporach. Just another thing is there any reason why you are using CASE here instead of the IF statement?
|
|
Top
|
|
|
|
#58126 - 2001-08-15 02:32 PM
Re: Advice for logging roaming users on
|
test_user
Fresh Scripter
Registered: 2000-02-29
Posts: 14
|
Julian,You can use the Case statement to select each of the sites: Case site1 do site1 script Case site2 do site2 script Case site3 do site3 script etc.
|
|
Top
|
|
|
|
#58127 - 2001-08-15 02:34 PM
Re: Advice for logging roaming users on
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
Doh!! Im with ya....yeah I think i'll look into doing it that way. Thanks very much!!
|
|
Top
|
|
|
|
#58129 - 2001-08-15 04:11 PM
Re: Advice for logging roaming users on
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
hmmmm, tried this with KiX 2001 and it works fine on a 98 client using DHCP but on mine which has a static IP and is NT it doesnt retrieve anything? Am i doing something wrong? Or can it not do this?im using the exact line you said: $defaultgateway = enumipinfo(0,3) ? $defaultgateway no info returned. any ideas?? oh and when i return the rror it says 50! [ 15 August 2001: Message edited by: Julian ]
|
|
Top
|
|
|
|
#58131 - 2001-08-15 04:20 PM
Re: Advice for logging roaming users on
|
Julian
Starting to like KiXtart
Registered: 2000-04-20
Posts: 112
Loc: Newcastle, Staffs, UK
|
ooops!! i'll read the manual properly next time.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1114 anonymous users online.
|
|
|