#183216 - 2007-12-03 09:00 PM
Drive mappings depending on logon server
|
choey
Fresh Scripter
Registered: 2007-12-03
Posts: 5
|
We are an educational environment. We have many users that roam between buildings and their drive mappings need to change depending on the building they are in. If they are in 1 school, they need to map drive G to the server in that building's Apps folder. If they are in another building, they need to map that server's Apps folder and so on. Below is the primitive logon batch file I have been using, which actually works. It is very slow though and I would like to convert it to Kix. Notice that I have 2 servers in each building, but the drives need to be mapped to the fs1 in each building. Also, I have about 15 buildings. I only pasted in the portion from 2 of the buildings. Thanks to anyone who can help me.
Chris
if /i "%LOGONSERVER%"=="\\ps01-fs1" (net use g: \\ps01-fs1\apps) if /i "%LOGONSERVER%"=="\\ps01-fs2" (net use g: \\ps01-fs1\apps) if /i "%LOGONSERVER%"=="\\ps01-fs1" (net use i: \\ps01-fs1\installs) if /i "%LOGONSERVER%"=="\\ps01-fs2" (net use i: \\ps01-fs1\installs) if /i "%LOGONSERVER%"=="\\ps01-fs1" (net use r: \\ps01-fs1\resources) if /i "%LOGONSERVER%"=="\\ps01-fs2" (net use r: \\ps01-fs1\resources) if /i "%LOGONSERVER%"=="\\ps01-fs1" (net use t: \\ps01-fs1\ttl_net) if /i "%LOGONSERVER%"=="\\ps01-fs2" (net use t: \\ps01-fs1\ttl_net) if /i "%LOGONSERVER%"=="\\ps01-fs1" (net use m: \\ps01-fs2\smecourses) if /i "%LOGONSERVER%"=="\\ps01-fs2" (net use m: \\ps01-fs2\smecourses) if /i "%LOGONSERVER%"=="\\ps01-fs1" (net use s: \\ps01-fs2\sme) if /i "%LOGONSERVER%"=="\\ps01-fs2" (net use s: \\ps01-fs2\sme)
if /i "%LOGONSERVER%"=="\\ps04-fs1" (net use g: \\ps04-fs1\apps) if /i "%LOGONSERVER%"=="\\ps04-fs2" (net use g: \\ps04-fs1\apps) if /i "%LOGONSERVER%"=="\\ps04-fs1" (net use i: \\ps04-fs1\installs) if /i "%LOGONSERVER%"=="\\ps04-fs2" (net use i: \\ps04-fs1\installs) if /i "%LOGONSERVER%"=="\\ps04-fs1" (net use r: \\ps04-fs1\resources) if /i "%LOGONSERVER%"=="\\ps04-fs2" (net use r: \\ps04-fs1\resources) if /i "%LOGONSERVER%"=="\\ps04-fs1" (net use t: \\ps04-fs1\ttl_net) if /i "%LOGONSERVER%"=="\\ps04-fs2" (net use t: \\ps04-fs1\ttl_net) if /i "%LOGONSERVER%"=="\\ps04-fs1" (net use m: \\ps04-fs2\smecourses) if /i "%LOGONSERVER%"=="\\ps04-fs2" (net use m: \\ps04-fs2\smecourses) if /i "%LOGONSERVER%"=="\\ps04-fs1" (net use s: \\ps04-fs2\sme) if /i "%LOGONSERVER%"=="\\ps04-fs2" (net use s: \\ps04-fs2\sme)
|
|
Top
|
|
|
|
#183219 - 2007-12-03 09:30 PM
Re: Drive mappings depending on logon server
[Re: choey]
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
This would be fairly easy to re-write based on IP subnets. Do you have a well defined mapping of subnets per building?
I would be happy to write something to satisfy the need if supplied with the data.
|
|
Top
|
|
|
|
#183222 - 2007-12-03 10:00 PM
Re: Drive mappings depending on logon server
[Re: choey]
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Here is an example of doing in KiX.
I thought about IP based like Howard mentions but did not think you would have it setup like that so I didn't go down that road. Also doing by IP can be quite problematic especially for laptops
;Remove all drive mappings so we dont have an old one
USE * /DELETE
Select
Case @LServer = '\\ps01-fs1' Or @LServer = '\\ps01-fs2'
USE G: '\\ps01-fs1\apps'
USE I: '\\ps01-fs1\installs'
USE R: '\\ps01-fs1\resources'
USE T: '\\ps01-fs1\ttl_net'
USE M: '\\ps01-fs2\smecourses' ;your example here is not using server 1
USE S: '\\ps01-fs2\sme' ;your example here is not using server 1
Case @LServer = '\\ps04-fs1' Or @LServer = '\\ps04-fs2'
USE G: '\\ps04-fs1\apps'
USE I: '\\ps04-fs1\installs'
USE R: '\\ps04-fs1\resources'
USE T: '\\ps04-fs1\ttl_net'
USE M: '\\ps04-fs2\smecourses' ;your example here is not using server 1
USE S: '\\ps04-fs2\sme' ;your example here is not using server 1
Case 1
'Unable to determine server so doing nothing'
EndSelect
|
|
Top
|
|
|
|
#183224 - 2007-12-03 10:04 PM
Re: Drive mappings depending on logon server
[Re: NTDOC]
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Without asking additional questions, I have a concern about only relying on logon server as the way of determining what building the computer is located.
I have seen some instances where the expected authentication server was not the actual logon server. This would lead to extremely slow performance as the drives would be mapped to the wrong building.
Edited by Howard Bullock (2007-12-04 05:40 AM) Edit Reason: spelling
|
|
Top
|
|
|
|
#183399 - 2007-12-07 03:52 PM
Re: Drive mappings depending on logon server
[Re: NTDOC]
|
choey
Fresh Scripter
Registered: 2007-12-03
Posts: 5
|
This looks like what I am looking for. I am out of the office on jury duty, so it will be a few days before I can try it. That's also the reaseon for the dely in this response.
Thank you very much.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1619 anonymous users online.
|
|
|