Solved

How to assign Mapped network Drives Per User

Posted on 2011-03-08
11
886 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 78

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 78

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 78

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Internet Speed Test 5 137
Connecting two servers 30 90
Question about consuming GB from Comcast 5 67
ISP Redundancy using IP SLA Monitor 2 47
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…
The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

763 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