#166184 - 2006-08-22 07:17 AM
Map drive by user id.
|
backbiter
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
|
|
|
|
#166187 - 2006-08-22 03:35 PM
Re: Map drive by user id.
|
backbiter
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
|
|
|
|
#166189 - 2006-08-22 06:20 PM
Re: Map drive by user id.
|
Witto
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
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
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
|
|
|
|
#166193 - 2006-09-02 08:24 PM
Re: Map drive by user id.
|
Witto
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
|
|
|
|
#166197 - 2006-09-17 02:57 AM
Re: Map drive by user id.
|
Glenn Barnas
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 507 anonymous users online.
|
|
|