Avatar of brandsco
brandsco
Flag for United Arab Emirates asked on

How to assign Mapped network Drives Per User

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
Microsoft Legacy OSWindows Server 2003Internet Protocols

Avatar of undefined
Last Comment
brandsco

8/22/2022 - Mon
SOLUTION
Steven Carnahan

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
8ubterfug3

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Steven Carnahan

@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!   :)

arnold

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?

Steven Carnahan

@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.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
arnold

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.
Steven Carnahan

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.
arnold

oh.:-)
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
brandsco

ASKER
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??
Steven Carnahan

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%
brandsco

ASKER
Ok. I got it.. I tried it and it really works just fine.. Thank You very much pony10us...
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes