Page 1 of 1 1
Topic Options
#166184 - 2006-08-22 07:17 AM Map drive by user id.
backbiter Offline
Lurker

Registered: 2005-06-22
Posts: 3
I have a number of users that need to have a drive mapped to certain folders with in a folder. Each folder is unique to them as they contain information on their students classes. My idea was to just map each one of these users to their respective folder which is what the powers that be want. This is not code but rather my idea of where I want to go with my script. Please pardon my lack of scripting knowledge. I am using 4.52Kix on Server 2003 AD with all XP clients.
If userid = jdoe
Map drive V to \\enterprise\MISD\Melis1\eclass\12
Now check for errors

Thanks for any help. This board has helped me a bunch with my short Kixtart career.

Top
#166185 - 2006-08-22 07:59 AM Re: Map drive by user id.
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
Using that logic you will have to do an IF for every student.

Much easier would be to set it to their home folder in AD, or to create a shortcut to it in their home folder.

Top
#166186 - 2006-08-22 08:52 AM Re: Map drive by user id.
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
If it is just info for one user, why don't you use the user directory?
Top
#166187 - 2006-08-22 03:35 PM Re: Map drive by user id.
backbiter Offline
Lurker

Registered: 2005-06-22
Posts: 3
Thanks for the replies. I had thought about this and I should have been a bit more clear about the use of these drives. They contain the teachers gradebooks that are used by their gradebook program so that is why I will have to do a mapping for each teacher. I tried using this.
If @userid = jdoe
use v: "\\server\share\melis1\eclass\12"
EndIf
It will debug fine after you log in but will not map with normal login. Any ideas?
Thanks guys.

Top
#166188 - 2006-08-22 03:43 PM Re: Map drive by user id.
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Try tracing-out the error on logon, example:

use v: "\\server\share\melis1\eclass\12"

?"ERROR " + @ERROR + " - " + @SERROR
?"Press any key..." GET$

-Shawn

Top
#166189 - 2006-08-22 06:20 PM Re: Map drive by user id.
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Still my question, if it is for their gradebook, only used by their gradebook program, and they just need one "shared" folder for just one user, nobody else needs to consult it, why don't you use the users directory?
Or do you want to use something like
Code:
\\FileServer\GradebookShare\TeachersName


If possible, just let the program write to \\FileServer\GradebookShare\%UserName%
Set (Read?) security for all teachers in one group on \\FileServer\GradebookShare\
and (Modify?) security per teacher on \\FileServer\GradebookShare\%UserName%

If in your example the teacher jdoe was teacher number 12, could you name the deepshare '\\server\share\melis1\eclass\' + @USERID
In last case, you still have to debug like Shawn suggests.

Top
#166190 - 2006-09-02 07:08 AM Re: Map drive by user id.
backbiter Offline
Lurker

Registered: 2005-06-22
Posts: 3
Sorry for the delay in getting back on this. What I had to do was to actually map each teacher to their folder(s). Did it like this. It did take more keystrokes than I would like but it worked. The way this program creates the databases for the gradebook dictated the way I had to do mappings for each teacher that uses it. We can't change the folder numbers so we had to just map to them which bombed out the idea of home drives. Thanks for the error code help. After a couple of debug passes I got the coding correct and it started working great.
Code:

If @userid = bdunn

Use L: "\\enterprise\WinSchl\Melissa Middle School\Melis101\eclass\18"
?"ERROR " + @ERROR + " - " + @SERROR
EndIf



Edited by backbiter (2006-09-02 07:13 AM)

Top
#166191 - 2006-09-02 07:47 AM Re: Map drive by user id.
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
An error message telling everything is OK is not really an error message, is it? IIWY I would drop that line.
Shawn suggested that line for tracing errors
Code:

Use L: /DEL
If @userid = "bdunn"
Use L: "\\enterprise\WinSchl\Melissa Middle School\Melis101\eclass\18"
EndIf


Top
#166192 - 2006-09-02 02:04 PM Re: Map drive by user id.
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
How many of these IF conditions are you processing? More than one and you should be using SELECT CASE constructs. If more than a dozen, then a total rethink is needed.
Top
#166193 - 2006-09-02 08:24 PM Re: Map drive by user id.
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Totally agree with Les, select would be better.
Code:

Use L: /DEL
Select
Case @USERID = "bdunn"
Use L: "\\enterprise\WinSchl\Melissa Middle School\Melis101\eclass\18"
Case @USERID = "SomeoneElse"
Use L: "\\enterprise\WinSchl\Melissa Middle School\Melis101\eclass\OtherNumberIPresume"
EndSelect


I would review the installation of the program itself. Does it support UNC paths? If I understand well, the userdata is being written to L:.
I would like p.e. that the userdata could be written to a path like
"\\enterprise\WinSchl\Melissa Middle School\Melis101\eclass\%USERNAME%".
No need to do tricks during logon.
IMHO, even a subdirectory in the userdirectory would be much better.

Top
#166194 - 2006-09-03 04:30 AM Re: Map drive by user id.
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Can't you make the users members of a group and then use the groups to do the mapping? I cannot imagine that each user would have a different folder to map to with no overlap between users. Don't think that a teacher is teaching only a single class.
_________________________
There are two types of vessels, submarines and targets.

Top
#166195 - 2006-09-03 06:31 AM Re: Map drive by user id.
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
If this is anything like the software that I have installed before it is even worst than the Jens,

Each teacher not only has their own folder within the directory structure, but the each of the classes they teach (like in high school they would have 5 classes) would have a seperate grade book within that folder.

Some of the company's that make educational software (grade books, attendance etc) have no concept of how to make anything network ready.

I remember many a program that "had" to be installed, and the program would not work unless "everyone" had full permissions to the install directory.

Top
#166196 - 2006-09-03 06:45 AM Re: Map drive by user id.
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Create groups named after each folder. Generate a list of folders a user belongs to and map according to that folder name. This way the code doesn't change and the mappings are controlled by assigning users to groups within Windows instead of within the script.
_________________________
There are two types of vessels, submarines and targets.

Top
#166197 - 2006-09-17 02:57 AM Re: Map drive by user id.
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
The KiX based login script on my web site supports this - called Path Rewriting.

You can define a resource record in the login config file, where
Code:
PATH=\\server\share\&USER:map_id&


This tells the drive mapping routine to use the user ID of the person logging in as a reference to a lookup record. The value returned by that record replaces the &USER:map_id& part of the path. That can be anything - the server, share, or deep-map directory name! Much easier to maintain the lookup records than multiple if/case statements, especially when user IDs change.

The login script can also do path rewriting based on AD Site IDs, as well as direct UserID and Site ID replacements, not to mention "normal" and even "complex" AD Group based mappings.

This type of functionality is helpful when you have a "team" of users to connect to a share that are not necessarily a specific AD group.

Navigate to the Products / Admin Toolchest section of my web site to locate the login script ZIP file.

Glenn

Top
#166198 - 2006-09-17 01:37 PM Re: Map drive by user id.
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
The MapDrive() - Maps a UNC name to a specific driveletter UDF also supports "rewrting" in form of macros, e.g.
Code:

;non-persistent map of \\SERVER\share to P: with e.g. label "Jens Meyer's personal share"
$rc = MAPDRIVE('P','\\SERVER\@USERID$',0,"@FULLNAME's personal share")

_________________________
There are two types of vessels, submarines and targets.

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 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.071 seconds in which 0.024 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