Page 1 of 1 1
Topic Options
#16822 - 2002-01-29 05:23 PM How hard is this to do with Kix???
ryanro Offline
Fresh Scripter

Registered: 2002-01-29
Posts: 10
Ok, here is the scenerio: I have 3 offices with 3 domain controllers in the same domain. I want to write a script that will allow a user in the remote office to login there and map all of his drives to the local server. Then if the user comes to another office, I want him to login with the same login but map to the shares on the local server in the new office. Here are the details:

Primary Domain Controller : NT1 Subnet: 10.0.0.0 255.255.255.0 Remote DC : Gonzales Subnet: 10.0.2.0 255.255.255.0 Name of login scripts that will be used: For Primary DC : perkins.bat For Remote DC : gonzales.bat

I'm trying to figure this out in vbs but someone told me to try kix first b/c it's a lot easier and more powerful than vbs. Does anyone out there know how to do this with kix?? Thanks in advance for your help..

Ryan

Top
#16823 - 2002-01-29 05:30 PM Re: How hard is this to do with Kix???
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
use the enumipinfo() command to determine which gateway is active on the lan adapter.

then run a select/case series to compare the results and match them to a specific server at that site.

then map your server using that server.

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#16824 - 2002-01-29 05:31 PM Re: How hard is this to do with Kix???
ryanro Offline
Fresh Scripter

Registered: 2002-01-29
Posts: 10
Speak english please...I'm new to scripting and have no clue where to start with this. Thanks for the help ...Can you write it for me based on the info I gave you??

Thanks
Ryan

Top
#16825 - 2002-01-29 05:37 PM Re: How hard is this to do with Kix???
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
code:

$gateway=enumipinfo(0,3)

select
case $gateway=" 10. 0. 0. 1"
$localserver="NT1"
case $gateway=" 10. 0. 2. 1"
$localserver="gonzales"
case 1
? "can't figure out where I am. Quitting"
quit
endselect

use h: "\\$localserver\share1"
use m: "\\$localserver\share2"
use s: "\\$localserver\share3"


_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#16826 - 2002-01-29 05:50 PM Re: How hard is this to do with Kix???
ryanro Offline
Fresh Scripter

Registered: 2002-01-29
Posts: 10
Thank you!!!
Top
#16827 - 2002-01-29 06:03 PM Re: How hard is this to do with Kix???
ryanro Offline
Fresh Scripter

Registered: 2002-01-29
Posts: 10
Whoops, one thing I forgot to mention is that if they are logging in to NT1, they will need to map drives to different servers and if the login to gonzales, they will only map to one server. Let me ask you this, is there a way in kix to call batch files, for example if it sees that the subnet is nt1, can it call nt1.bat and vice versa for gonzales. If so, can you give me an example.

Thanks again for the help

Ryan

Top
#16828 - 2002-01-29 06:23 PM Re: How hard is this to do with Kix???
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3164
Loc: Houston TX
if a user is logging in the the 10.0.0 subnet you want to map X drives, and if logging in from the 10.0.2 subnet map Y drives... is this right?

Bryce

Top
#16829 - 2002-01-29 06:25 PM Re: How hard is this to do with Kix???
ryanro Offline
Fresh Scripter

Registered: 2002-01-29
Posts: 10
yeap, exactly..Here it is in full:

User logs in to 10.0.0.1:
net use j: \\nt3\public
net use p: \\nt1\projects
net use i: \\nt2\shared

User logs in to 10.0.2.1

Net uses everything on one server, not multiple..

Top
#16830 - 2002-01-29 06:30 PM Re: How hard is this to do with Kix???
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3164
Loc: Houston TX
If you are using Kix4.0 i suggest using one of the 2 Subnet UDF's that are out there.


Subnet() By Bryce
IsInSubnet() By sealeopard

Bryce

Top
#16831 - 2002-01-29 06:39 PM Re: How hard is this to do with Kix???
ryanro Offline
Fresh Scripter

Registered: 2002-01-29
Posts: 10
Now I'm really confused ..Keep in mind, I've never used kix or programmed before. My boss asked me to do this for him and I have no clue where to start...
Top
#16832 - 2002-01-29 06:44 PM Re: How hard is this to do with Kix???
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
code:

$gateway=enumipinfo(0,3)
select
case $gateway=" 10. 0. 0. 1"
shell "\\nt1\netlogon\perkins.bat"
case $gateway=" 10. 0. 2. 1"
shell "\\gonzales\netlogon\gonzales.bat"
case 1
? "can't figure out where I am. Quitting"
quit
endselect

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#16833 - 2002-01-29 06:45 PM Re: How hard is this to do with Kix???
ryanro Offline
Fresh Scripter

Registered: 2002-01-29
Posts: 10
Thanks again!!! Now do you know how to do it with vbs

Ryan

[ 29 January 2002: Message edited by: ryanro ]

Top
#16834 - 2002-01-30 05:21 PM Re: How hard is this to do with Kix???
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
Another way, use @LSERVER value, which will tell you the domain server authenticating the client. Can be something such as:

code:

SELECT
CASE (@LSERVER = "\\PDC")
$localsvr = "PDC"
CASE (@LSERVER = "\\BDC1)
$localsvr = "BDC1
CASE (@LSERVER = "\\BDC2")
$localsvr = "BDC2
ENDSELECT

This especially true if running KiX 3.x, as 'enumipinfo' is only in KiX 4.x.

Bill

Top
#16835 - 2002-01-30 05:32 PM Re: How hard is this to do with Kix???
ryanro Offline
Fresh Scripter

Registered: 2002-01-29
Posts: 10
It still isn't working, it jumps straight to case 1 and quits....
Top
#16836 - 2002-01-30 06:35 PM Re: How hard is this to do with Kix???
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22333
Loc: OK
ryanro, instead of
case $gateway=" 10. 0. 0. 1"
try it with:
case instr("$gateway","10.0.0.1")
or just
case $gateway=" 10.0.0.1"

in the case 1 print out the gateway variable to see which is the correct syntax.
like:
case 1
"gateway is $gateway" get $
quit

_________________________
!

download KiXnet

Top
#16837 - 2002-01-30 07:55 PM Re: How hard is this to do with Kix???
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
ryanro -
What version of KiX are you using?

Top
#16838 - 2002-01-30 08:42 PM Re: How hard is this to do with Kix???
ryanro Offline
Fresh Scripter

Registered: 2002-01-29
Posts: 10
The most recent one from this site...
Top
#16839 - 2002-01-30 08:50 PM Re: How hard is this to do with Kix???
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
ryanro,
Watch your spacing on the IP. The examples are all over the map.

Everyone is offering up suggestions, yet you don't say what you're using so how can anyone know what's going wrong. Try posting some code.

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

Top
#16840 - 2002-01-30 08:55 PM Re: How hard is this to do with Kix???
ryanro Offline
Fresh Scripter

Registered: 2002-01-29
Posts: 10
Don't worry about it, I got it. Thanks to the post about seeing what gateway it's using. Thanks for all the help everyone!!!!
Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 155 anonymous users online.
Newest Members
emnipetro, Hirze, thequeen, ameliaryan, shalomsalami
17641 Registered Users

Generated in 0.04 seconds in which 0.012 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