Page 1 of 1 1
Topic Options
#46294 - 2003-10-03 04:30 PM Maps to logon server
Shintra Offline
Fresh Scripter

Registered: 2003-10-03
Posts: 6
Loc: Enschede / Netherlands
Hello everyone.
I'm rather new to using kixstart.

This is my situation:

There are 3 subnets, 3 Domains and all of them have a data share M:(data$)and a applications share O: (apps$)

In my script users are provided with the mappings to the shares like this:

If InGroup("Groupname")
use M: \\"Servername\data$"
use O: \\"Servername\apps$"
ENDIF

If a user switches from subnet, his M: and O: mappings will allways point to the same server.
Which obviously is very bandwith intensive, since there are three geographicaly spread locations.

How can I achieve that, when a user logs on, his M: and O: mapping will point to the logonserver?

Can I user variables for this, and what do they look like?

Any reactions will be very welcome.

Greetz,

Shintra

Top
#46295 - 2003-10-03 04:36 PM Re: Maps to logon server
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See the KiXtart Manual under the 'MACRO' section, e.g. @LSERVER.
code:
USE M: /delete /persistent
USE M: @LSERVER+'\data$$'

or use any of the 'map drive' UDFs.
_________________________
There are two types of vessels, submarines and targets.

Top
#46296 - 2003-10-03 11:46 PM Re: Maps to logon server
Clancy Offline
Fresh Scripter

Registered: 2002-08-26
Posts: 14
Loc: Reno, NV
What about using @site to map these clients, provided you have active directory (which you didn't say you did or didn't).

I've never played with it myself, I'm still living in a very heterogeneous network environment of 9x / 2k / XP clients.

Top
#46297 - 2003-10-04 03:52 PM Re: Maps to logon server
Shintra Offline
Fresh Scripter

Registered: 2003-10-03
Posts: 6
Loc: Enschede / Netherlands
Thank you,

This is very usable information.
I read about the @Lserver macro in the manual but did not know how to use it correctly.

This will very likely solve my problem.

And, yes, indead we use AD.
So the use of @site could be very interesting.
I'll see if I can do something with it.

Greetz,
Shintra

Top
#46298 - 2003-10-04 04:22 PM Re: Maps to logon server
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Another option is to provide mappings based on subnets by using the IsInSubnet() UDF. Example:
code:
select
case isinsubnet(@IPADDRESS0,'192.168.1.0/24')
use m: '\\server1\share'
case isinsubnet(@IPADDRESS0,'192.168.2.0/24')
use m: '\\server2\share'
endselect

For more info please see the FAQ Forum under TCP/IP Primer, Part I - IP Addresses
_________________________
There are two types of vessels, submarines and targets.

Top
#46299 - 2003-10-04 04:25 PM Re: Maps to logon server
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
The subnet approach is far more relaible as the authenticating DC is not always in the same subnet as the client.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#46300 - 2003-10-06 01:47 PM Re: Maps to logon server
Shintra Offline
Fresh Scripter

Registered: 2003-10-03
Posts: 6
Loc: Enschede / Netherlands
Hello,

I used the macro @lserver and this gives a good result.

I tried the option "case isinsubnet" stated 2 posts back, but I can't get this working.
Searched for options using the expresion "isinsubnet" but didn't find anything.

The macro @site would be nice to use but since we do have 9x clients as well, this won't realy work.(unless dsclient must support this compatibility)

Thx for all your answers.
If anyone knows how I can correctly use the "isinsubnet" expression that Sealeopard came up with, please make a post.

Greetz,

Shintra

Top
#46301 - 2003-10-06 01:56 PM Re: Maps to logon server
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Hmm..

Cannot find isinsubnet..

Go to Search..

Search words: isinsubnet

You could change it to "Search all open forums", but we'll change it to "UDF Library"..

Voila!

There are five results for you.

HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#46302 - 2003-10-06 07:18 PM Re: Maps to logon server
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
[Confused] I also pointed you to the TCP/IP Primer, which, among other things, does list a link to the IsInSubnet() UDF.
_________________________
There are two types of vessels, submarines and targets.

Top
#46303 - 2003-10-28 11:42 AM Re: Maps to logon server
Shintra Offline
Fresh Scripter

Registered: 2003-10-03
Posts: 6
Loc: Enschede / Netherlands
I'm Sorry,

I'm not experienced using code, that's why I visit this BB.

What I meant actually is that I could not find out how to use it correctly.

On and off I tried some lines in the script but I can't get ik working.

I'd like to use the code provided by Sealeopard

Select
case isinsubnet(@ipaddress0,'192.168.1.0/24')
use u: '\\server1\share'
case isinsubnet(@ipaddress0,'192.168.2.0/24')
use u: '\\server2\share'
endselect

When I use this in my script, it gives an error in the line; 'case isinsubnet(@ipaddress..)

Part of the script looks like this;
_____________________________________________
IF INGROUP("TKH")
USE M: /DELETE /PERSISTENT
USE M: @LSERVER+"\DATA$"
USE O: /DELETE /PERSISTENT
USE O: @LSERVER+"\APPS$"
ENDIF

@IPADDRESS0

SELECT
CASE ISINSUBNET(@IPADDRESS0,"10.10.10.0/24")
USE U: "\\S000\"+@USERID+"$"
CASE ISINSUBNET(@IPADDRESS0,"10.10.20.0/24")
USE U: "\\S001\"+@USERID+"$"
ENDSELECT
_____________________________________________

Obviously I'm going wrong somewhere, so please help.

I don't want to use @site because we still have W9x clients.

Greetz,
Shintra

Top
#46304 - 2003-10-28 01:07 PM Re: Maps to logon server
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
it seems that you don't have isinsubnet() UDF in your script thus it errors.

that's a quess as you didn't provide the error.
_________________________
!

download KiXnet

Top
#46305 - 2003-10-28 03:32 PM Re: Maps to logon server
Shintra Offline
Fresh Scripter

Registered: 2003-10-03
Posts: 6
Loc: Enschede / Netherlands
Hello Basta,

Thx for your information.

What I want the result of the script to look like is for users only to have a U: mapping when they are in their "home"subnet.
When a user logs on in any other subnet, he should not get a U: mapping.
The M: and O: mapping can always exist.

Following is the testscript I use to find out how to provide user with a U: mapping based on their subnet.
__________________________________________________
;DEBUG "ON"

IF INGROUP("TKH")
USE M: /DELETE /PERSISTENT
USE M: @LSERVER+"\DATA$"
USE O: /DELETE /PERSISTENT
USE O: @LSERVER+"\APPS$"
ENDIF

@IPADDRESS0

SELECT
CASE ISINSUBNET(@IPADDRESS0,"10.10.10.0/24")
USE U: "\\S000\"+@USERID+"$"

CASE ISINSUBNET(@IPADDRESS0,"10.10.20.0/24")
USE U: "\\S001\"+@USERID+"$"
ENDSELECT

SELECT
CASE INGROUP("DKP-PRINTER1")
AddPrinterConnection("\\S000\DKP-PRINTER1")

CASE INGROUP("ENS-PRINTER1")
AddPrinterConnection("\\S000\ENS-PRINTER1")

CASE INGROUP("HBG-PRINTER1")
AddPrinterConnection("\\S001\HBG-PRINTER1")
ENDSELECT
__________________________________________________
The error returned is;

Error : expected expression!
Script: c:\kixtart.kix
line : 13

I'm using kixtart version 4.21 from the netlogon share using a Windows 2000 client.

I also tried the following lines;

Select
case ingroup("S000")and isinsubnet (@ipaddress0,"10.10.10.0/24")
use u: "\\S000\+@userid+"$"

case ingroup("S001") and isinsubnet(@ipaddress0,"10.10.20.0/24")
use u: "\\S001\+@userid+"$"
endselect

Earlier today I read something about that technique is making it easier for the complex mind and more complex for the simple mind.

To me this is true about scripting, that's why I turned to this BB.

Something is missing in my script.
Could you tell me what?

Greetz,
Shintra

Top
#46306 - 2003-10-28 03:38 PM Re: Maps to logon server
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
quote:
Something is missing in my script.
Could you tell me what?

...and like the basta said...
quote:
it seems that you don't have isinsubnet() UDF in your script thus it errors.

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#46307 - 2003-10-28 04:01 PM Re: Maps to logon server
Shintra Offline
Fresh Scripter

Registered: 2003-10-03
Posts: 6
Loc: Enschede / Netherlands
Thanks Les,

You're right and I know you are.
But that's what I don't know about my issue.
How does this UDF look like and where do I place this in my script?

Greetz,
Shintra.

Top
#46308 - 2003-10-28 04:09 PM Re: Maps to logon server
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Hmmm... went browsing to the FAQ section and saw you there... Well, since I'm here, the FAQ you need to read is Topic: How to use UDFs
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

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 874 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.144 seconds in which 0.103 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