Discussion Locked

Mapping drives on logon to NT server

0 helpful
18 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

OK here goes, not even sure if this is possible.

School server with 1700 users in the 'student' group. Each one has a shared directory on the network.

How can I set up an NT logon script that gives them direct mapping to their own folder.

Everything I have tried so far maps only to the main share where the user folders are sub folders from this.

Students being kids - they will just delete other users folders (with access to the main share they can easily do this.

Any help gratefully received
Paul

18 replies

by timber

A couple options
1. all the user directories create as hidden shares username$ map there drive to \\servername\username$
2. Set permisions on the directories so that only that student and domain admins has Change rights to the user dir. and read rights to the main share.

by wolfman9

All the user shares are already set up using the user manager tools, there are 1600 users I really don't want to have to redo that many accounts by hand

by wolfman9

You can't change the user rights main share without affecting the rights to each individual folder

by elmagoal

What you need is to make all those shares hiden shares, by putting a $ at the end of the name. and map each account to the hidden share or putting a path in usermanager\profile\connect put a drive letter and the path to the hidden share.
or try something like this using kix32
IF INGROUP("ADMIN-1")
USE f: "\\test1\apps"
USE s: "\\test2\common"
USE J: "\\data4\common"
ADDPRINTERCONNECTION("\\pserver4\admin-1")
ENDIF
If you need more info goto
http://kixtart.org/

by nbcasey

This is how we do it, every user has a share created for them that is called their logon Id. For example, if you logon was bob, you would have a share called bob. Now in order to map these, in the logon script simply put the following line:

NET USE Z: \\yourserver\%USERNAME%

You can change the drive to whatever you want. Granted it takes some time to set up, but it works great.

by sdfgsdf

you can add the command 'NETUSE' to the end of your logon script. if you are unfamiliar with this, i have incuded a sampple script. replace the instances of USERNAME, SERVERNAME and SHARENAME with your clients logon name, server's computer name and the network share you want mapped. give each group of students a custom script. here you go...

@echo off
REM
REM This file is the template used to create the logon script for each user.
REM

REM
REM If this is running on dos, exit
REM

if"%windir%" == "" goto exit

if "%COMPUTERNAME%" == "" goto proc_test
if "%COMPUTERNAME%" == "SERVERNAME" goto exit

:proc_test

REM
REM Use PROCESSOR_ARCHITECTURE to pick the right directory
REM

if "%PROCESSOR_ARCHITECTURE%" == "" set DIRECTORY=win95
if "%PROCESSOR_ARCHITECTURE%" == "x86" set DIRECTORY=i386
if "%DIRECTORY%" == "" goto exit

\\SERVERNAME\Clients\Setup\%DIRECTORY%\startcli.exe /s:SERVERNAME /u:USERNAME /l:%windir%\..\startcli.log

NET USE X: \\SERVERNAME\SHARENAME

:exit

by cory.hopple

My solution is the same as Answer #3 but I wrote a script that automated the logon script editing. Going though and modifying 1700 scripts is not fun or productive.

My script simply adds the line
net use h: \\servername\%username%
to the existing logon scripts I modified 600 scripts in under 2 minutes.

by derek

PART ONE:
If your share is working correctly, but users have access to each other's folders then the home directories were not made correctly.

Windows NT User Manager will make home directories for you _and_ set correct permissions on them. No person will be able to enter/modify/delete someone else's folder.

If that is not the case, then the home directories need to be re-made anyway, but it's easy, trust me.

To make home directories the right way, create a share on your server, shared with: Administrators (local group) Full Control, and Everyone (or the correct group of users) Change. Everyone must have Change to the SHARE in order to create/modify/delete files in their own folder.

Now, also edit the Security (file) permissions for the folder that is the share point. The security permissions should be:
Replace permissions on subdirectories: UNCHECKED.
Replace permissions on existing files: CHECKED.
Administrators (local group) Full Control, Everyone Read.
This makes it so normal users cannot add files to the share itself. In other words the folders bob, mary, joe, etc will be visible but no one can put files in the same directory as the folders.

Now, using User Manager for Domains, select all the users who will have home directories in the new share. Use SHIFT-select or CTRL-select to highlight them all. Alternatively, you could go to the User menu, choose Select Users, click the group called Domain Users, then hit Select, then Close.

by derek

PART TWO:

Press the Enter key to bring up the properties dialog box for all the selected users. Alternatively you could go to the User menu and choose Properties. Be careful with this, since any change here affects _all_ currently selected users!

Once in the properties box, click the Profile button. Under Home Directory, choose the Connect item, select the drive letter you want it to map to (most people use H: meaning Home) then type in the To box:
\\SERVERNAME\SHARENAME\%USERNAME%
Fillin the correct server and share name for your situation, but the %USERNAME% is literal. User Manager will fill that in with ach user's logon name.

Press OK. This may take a few minutes.
Press OK (or Close). Again this may take a few minutes.

Now, your home directories are created, and each user can only get in their own directory.

I know this seems long, but once you've done it a few times it's really very easy.

-- Derek

(1930 characters isn't enough!)

by john cranny

NT by default only allows you to map a drive to a share name. It sounds like you have one share (I'll call it "Students") & a directory under this for each student (I'll also assume that the students directories are named the same as their usernames). You should really rename your shares so each student has a hidden share. But I wouldn't want to do that either. The OTHER OPTION is to use MS Distributed File System (do a search for DFS on the MS homepage). This is actually intended to distribute file shares across multiple machines, but it has a feature allowing you to MAP NETWORK drives TO ANY FOLDER in a share. Install the application, re-boot the PC & add a DFS volume (make sure to point this to your existing share). Once this is in, edit your logon script to use the new share path - net use h: \\Server\DFS\Students\%Username%.
Any questions, send me an email - john.cranny@bt.com

This discussion is closed to new replies.