Link to home
Start Free TrialLog in
Avatar of brandsco
brandscoFlag 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...

Avatar of Steven Carnahan
Steven Carnahan
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

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

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?


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

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.
Avatar of brandsco


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??
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%
Ok. I got it.. I tried it and it really works just fine.. Thank You very much pony10us...