Page 1 of 1 1
Topic Options
#128447 - 2004-10-27 01:01 PM Need scripting help
Paul_Sexton Offline
Lurker

Registered: 2004-10-27
Posts: 2
Hi,

I currently run 2 sites based in the UK and Germany. The two sites both exist on the same domain but with different IP address scopes.
UK - 164.84.178.***
Germany - 164.84.179.***


In my company we install patches regualarly on the pc's. We have these patches install from a local site file server using a login script with kixtart. Here is an example of part of the login script for the UK:

; Shortcuts
$File = "\\UKFILESVR\"
; End Shortcuts

; Start Global Mappings
use z: /delete ;remove current mapping to be safe
use z: $file + "Software" ;Map the IT Software Share
; End Global Mappings

; Start Group Mappings
if ingroup ("Domain Users")
run "z:\Patch.exe"
endif
; End Group Mappings

If the user resides in Germany they have a different login script in their profile that executes the same patch but from the local file server in Germany.
Here is their login script.

; Shortcuts
$File = "\\GERFILESVR\"
; End Shortcuts

; Start Global Mappings
use X: /delete ;remove current mapping to be safe
use X: $file + "Software" ;Map the IT Software Share
; End Global Mappings

; Start Group Mappings
if ingroup ("Domain Users")
run "X:\Patch.exe"
endif
; End Group Mappings


The problem we have is if we have people from the UK travelling to Germany, they logon to the network in Germany and their login script automatically checks for a patch from the UK file server. Some of these patches can be as big as 30MB so obviously we dont want them downloading this across the WAN. What i would like to achieve from Kixtart, but unfortunately dont have the programming knowledge to do, is if a UK user travels to Germany (they automatically receive a 164.84.179.*** IP address by DHCP, Vice versa if a Germany user comes to the UK they automatically get a 164.84.178.*** IP address) kixtart knows what IP address they have and executes the patch from the local site file server. So i was think integrate both the UK and Germany login scripts and if kixtart could define which patch to run, i.e. the patch on the Z drive (UK) or the patch on the X drive (Germany) based on the users ip address.

Does anyone know how i could program this into the batch file?

Thanks.

Paul

Top
#128448 - 2004-10-27 01:42 PM Re: Need scripting help
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Within your Kixtart script you could make this decision quite easily...

Consider this :

Code:

select
case split(@ipaddress0,".")[2] = "178"
;Do your shtuff for the England login
case split(@ipaddress0,".")[2] = "179"
;Do ze German fings
case 1
;something odd happened here
endselect





Edited by Jochen (2004-10-27 01:44 PM)
_________________________



Top
#128449 - 2004-10-27 03:11 PM Re: Need scripting help
Paul_Sexton Offline
Lurker

Registered: 2004-10-27
Posts: 2
That worked perfectly thanks for the fast response
Top
#128450 - 2004-10-28 04:41 AM Re: Need scripting help
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See also the FAQ Forum for extensive examples on using various network-related UDFs.
_________________________
There are two types of vessels, submarines and targets.

Top
#128451 - 2004-10-28 09:24 AM Re: Need scripting help
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
You could also copy a 100k flag file to the system and time it. Then you would know if a user was on a slower link such as modem or some other link issue so that you did not copy down the 30MB file.

Between checking IP and a flag file you should be able to accomodate most client file copies correctly.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1003 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.055 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org