Page 1 of 1 1
Topic Options
#52300 - 2000-11-21 05:16 PM Running different logon scripts
Anonymous
Unregistered


Hi
We are running NT 6 SP4 servers with 95/98 clients across 7 subnets.

We want to run a Kix logon script that will identify the subnet the user is loging on to and then map a drive depending on this.

Does anyone know how to do this.

Cheers



Top
#52301 - 2000-11-21 08:32 PM Re: Running different logon scripts
Paul_Berquam Offline
Hey THIS is FUN

Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
You my friend are in luck. That is exactly what I did here:

The only prerequisite that this has is that you have global groups defined that indicate where the user's home location is. Not my actual script, but it will give you an idea as to how I did it. Hopefully someone else will take this and show me the error of my ways.

Basically it gets the user's IP address, then uses a Select case to determine which location the user is at by the subnet, then associate the local common resources for the user (global shares, printers, common programs) and map to those instead of the same ones at the user's home location, no sense in tying up a WAN for something local is my thinking.

Then it determines the user's domain membership (if multiples exist) to determine the specific features of that domain's users drives, etc.

Next it looks at the location group that the user belongs to to determine maps specific to that group and assigns them.

Finally it goes as maps any common maps that may exist. In my case we're using the Trend Officescan product and anyone here that uses it knows that the Autopcc program is a pig over a WAN or RAS connection and running it locall can speed up the program substantially. I'll stop rambling now
Any comments would be greatly appreciated

code:


;TCPIP Check
$TCPIP = @IPAddress0
$1octet = val(substr($TCPIP,1,3))
$2octet = val(substr($TCPIP,5,3))
$3octet = val(substr($TCPIP,9,3))
$4octet = val(substr($TCPIP,13,3))

If @RAS > 0
;goto ONRAS
endif

SELECT
case $1octet = 111 AND $2octet = 222
Select
Case $3octet = 333
If $4octet >= 129 AND $4octet <=256
$Location = "location 333 high name"
$Globalserver = "Local Common resource server name"
$ResourceServer = "Otherservername"
$TimeServer = "timeservername"
else
$Location = "location 333 low name"
$Globalserver = "Local Common resource server name"
$ResourceServer = "Otherservername"
$TimeServer = "timeservername"
endif

Case $3octet >= 110 AND $3octet <= 111
$Location = "Mysite"
$Globalserver = "Local Common resource server name"
$ResourceServer = "Otherservername"
$TimeServer = "timeservername"
EndSelect

;All Remote/Field Offices
case $1octet = 111 AND $2octet = 222 AND $3octet = 334
Select
Case $4Octet >= 1 AND $4octet <= 16
$Location = "???"
$Globalserver = "Local Common resource server name"
$ResourceServer = "Otherservername"
$TimeServer = "timeservername"

Case $4Octet >= 17 AND $4octet <= 31
$Location = "Anytown, USA"
$Globalserver = "Local Common resource server name"
$ResourceServer = "Otherservername"
$TimeServer = "timeservername"

Case $4Octet >= 65 AND $4octet <= 127
$Location = "Anothersite"
$Globalserver = "Local Common resource server name"
$ResourceServer = "Otherservername"
$TimeServer = "timeservername"

Case 1

EndSelect

$GlobalDrv = "U:" ;drive letter that users map the global resource drive to

Select
Case Ingroup("domain1\Domain Users") = 1
$HomeDomain = "domain1"
? "In Domain1\Domain Users"
$Home = "domain1"
$UserServer = "userserver1" ;This is the server where the user shares reside
$UserDrv = "F:" ;The drive letter that users from this domain
;map their 'home' drives to

Case Ingroup("domain2\Domain Users") = 1
$HomeDomain = "domain2
? "In Domain2\Domain Users"
$Home = "domain2"
$UserServer = "userserver2"
$UserDrv = "H:"


Case 1
$Homedomain = "Unknown"
? "In Other"

EndSelect

Select
case INGROUP("location1") = 2
;map these drives
$server = server1

case INGROUP("location2") = 2
;map these drives
$server = server2

case INGROUP("location3") = 2
;map these drives
$server = server3
endselect

;common maps
;map global resources
? "Connecting P: to \\$server\Apps " use P: "\\$server\Apps" $NET_USE_OPTIONS
? "Connecting G: to \\$globalserver\global " use P: "\\$server\Apps" $NET_USE_OPTIONS


------------------
"He was a good little monkey and always very curious..."

[This message has been edited by Paul_Berquam (edited 21 November 2000).]

_________________________
He was a good little monkey and always very curious...

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1821 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.126 seconds in which 0.109 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