Solved

How to assign Mapped network Drives Per User

Posted on 2011-03-08
11
884 Views
Last Modified: 2012-06-27
Hi All

Im using Windows Server 2003 as a file server in which i want to perform some functions

i have different users in Finance Department
1. Jun
2. Imran
3. Mera
4. April
5. Rizwan
6. Hannah

For each of them i have a shared folder in the server by the same name with appropriate share and security permissions assigned.

Now in AD, all these Users are inside Finance Users OU.. and there is a GPO Assigned to Finance Users OU.. In this GPO i have created a logon script net use z: \\win2k3dc\accounts

This will create a mapped network drive for all 6 users in Finance Department with accounts folder.

Now i want a Y: Drive in their My Computer with their separate Shared Folders..

I cannot find a way how to do that, Of course if i put each in separate OU i can, but i dont want to separate them just for assigning a mapped network drive, please provide solution for this issue.. thank you...

regards
Siraj
0
Comment
Question by:brandsco
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 26

Assisted Solution

by:pony10us
pony10us earned 250 total points
ID: 35071226
Try:

net use y: \\<share>\%USERNAME%

<share> = the share where the user folder resides

%USERNAME% is the Set variable for the person logged in.
0
 
LVL 2

Accepted Solution

by:
8ubterfug3 earned 250 total points
ID: 35071250
You  can use variables in your script to map a drive based off of a user name. For example... make sure you have your shared folders created and named the same as the user account that will be accessing them. Of course also make sure permissions are set correctly for each. In your script add something like

net use Y: \\server\share\%USERNAME%

If a user has an account like msmith, the Y:\ Drive would map to \\server\share\msmith.
0
 
LVL 26

Expert Comment

by:pony10us
ID: 35071328
@8ubterfug3:

Thank you, I just read my post after looking at yours and noticed that I forgot to include the server in my command.  OOPS!   :)

0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 77

Expert Comment

by:arnold
ID: 35071974
You would need to use a vbscript rather than a simpler batch file.
Using vbscript you can test group membership etc. to assign/map/overlay

The one thing not clear to me is your Y: drive inside the my documents reference.
Are you looking for adding a shortcut to the mapped Y drive inside the my documents folder?

The others covered the use of variables in batch files login/logout files.

The only draw back I see with your implementation deals with the need to create a per user directory within the location or have the Accounting parent directory with full access to the users so that your batch can check whether the directory exists and if not create it prior to mapping the Y: drive.
This would also seem to defeat the purpose of a separate directory which presumably is there to limit what the other users can access.
i.e. have one common location \\server\accountingshare and then have \\server\someothercentralshare\%username% which only the %username% and the Administrators can access.
Do you use folder redirection such that My documents/desktop etc. will be on a server somewhere and will be accessible by the user no matter which workstation they are on?

0
 
LVL 26

Expert Comment

by:pony10us
ID: 35072060
@arnold:

I understand what you are attempting to say however I think you may have miss-read the original question.

You stated:  "The one thing not clear to me is your Y: drive inside the my documents reference" when in the original quesion was "Now i want a Y: Drive in their My Computer ..."

As for vbscript to test group membership etc. you can do that in batch as well however there was no mention of needing that functionality. It looks like the author is using GPO to control that instead.
0
 
LVL 77

Expert Comment

by:arnold
ID: 35072241
pony10us, The person wants a Y: drive in their My documents. The only way to achieve this is by creating a shortcut within the My documents to Y: drive when the Y: drive is mapped.
The Y: drive is not in My documents.

I am uncertain what you intended to correct.

a vbscript as a login script within a GPO provides more flexibility to perform the various tasks.
Presumably if the asker now wants to map drives per user, they will eventually move towards a more complicated scenario i.e. usera, userb who are also members of groupa have to have access to drive Z: as well as have specific printers mapped etc.

The comments you and 8ubterfug3 posted will address the direct question the asker asked, I'm just trying to see whether what they are asking for is in pursuit of a more complex function.

Another option is to use a more power/option reach approach using vbscript/powershell etc.
0
 
LVL 26

Expert Comment

by:pony10us
ID: 35072362
arnold,

As stated, I agree with everything you have stated about the vbscropt vs. batch. vbscript/powershell offers more flexibility than batch.

What I was pointing out was that they stated they want the Y: drive in "My Computer" and not "My Documents". In other words, all they want is a mapped drive (Y:) pointed to the share that contains the individuals personal folder.
0
 
LVL 77

Expert Comment

by:arnold
ID: 35072927
oh.:-)
0
 
LVL 1

Author Comment

by:brandsco
ID: 35098522
Hi.. Sorry for delayed response.. I have created folders exactly as their domain usernames. But I don't know how to create the set variable to %username% can any one help me on that pls??
0
 
LVL 26

Expert Comment

by:pony10us
ID: 35098569
The set variable %username% is created when they log into the domain.  If open a command prompt window on a work station and type "set" with out the paranthesises you will get a list of the environment variables in alphabetical order. Near the bottom (usually) you should see USERNAME= and that would be what is returned as %username%
0
 
LVL 1

Author Comment

by:brandsco
ID: 35136946
Ok. I got it.. I tried it and it really works just fine.. Thank You very much pony10us...
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question