Solved

Map drive for any user that logs into a pc

Posted on 2012-04-02
16
342 Views
Last Modified: 2012-04-05
I want to map a drive for any user that logs into two pc's.  I am not sure how to do it with group policy, or if it can be done in an easier way.  The server is a 2003 server, and we are a 2008 domain.
0
Comment
Question by:asrvwiz
  • 5
  • 5
  • 4
  • +1
16 Comments
 
LVL 15

Expert Comment

by:achaldave
ID: 37797815
create drive mapping script (.bat file) and put it in startup folders (C:\Documents and Settings\All Users\Start Menu\Programs\Startup\) of all users on both PCs.

here is the batch file command
net use X: \\server\share

replace X with available drive letter you want to use on that PC and \\server\share with actual path.
0
 
LVL 9

Accepted Solution

by:
Frank McCourry earned 166 total points
ID: 37797820
You'll need a logon script that runs for the computers you designate.  You can use the following to create a logon.bat file:

net use f: /D  ' Deletes any mapped instance of drive f:, use a drive letter of your choice here'
net use f: \\servername\filepath ' Maps drive f: to the share'

Then you simply create an OU (Organizational Unit) in Active Directory, move the computers you want to run the script into that OU and then use the group policy management console to create the policy that will run the script if any computer in that OU logs on.

You will find this helpful: http://technet.microsoft.com/en-us/library/cc779329(v=ws.10).aspx
0
 
LVL 9

Assisted Solution

by:Geodash
Geodash earned 334 total points
ID: 37797829
Set the Group Policy to map to the PC the drive
http://www.howtogeek.com/99403/it-how-to-map-network-drives-on-windows-clients-via-group-policy/


If you are on a 2008 domain, manage your GPO's from the 2008 DC, not 2003
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.

 

Author Comment

by:asrvwiz
ID: 37797843
I tried net use g:\server\share from a batch file when the user was logged in and it said bad user name or password.  I used GPO with a user group and it worked, so I know that the credentials are good, but I only want it on these two PC's.

The PC's can not be moved out of the OU, they get printers based on that now.
0
 
LVL 9

Expert Comment

by:Frank McCourry
ID: 37797940
Create an OU that is below the OU that they are in.  The GPO from the upper level OU will still apply.
0
 
LVL 15

Expert Comment

by:achaldave
ID: 37797949
Are you trying to pass credentilals from batch file? What happens if user types \\server\share in run window?

The correct sytext for net use command is

net use X: \\server\share not net use X:\server\share
0
 
LVL 9

Expert Comment

by:Geodash
ID: 37797954
If you want every user to have the mapped drive, why would you be worried about credentials?
0
 

Author Comment

by:asrvwiz
ID: 37797976
Yes the net use g:\ was a typo on my part.  

I want the drive mapped for all users that log on to two specific PC's.

I looked at the howtogeek link, not sure how that works since I did not see them use any item level targeting?
0
 
LVL 9

Expert Comment

by:Frank McCourry
ID: 37797986
To pass credential in the batch file:

net use f: /D
net use f: \\server\share password /USER: domain\username

I definitely do not recommend doing this as is exposes the users password in a plain text file.
0
 
LVL 9

Expert Comment

by:Geodash
ID: 37798002
If you are server 2008, why would you create a bat file to do this instead of using the mapped drives feature in GPOs?

Assign a mapped drive to all users, mapping that drive to an OU containing the PC's you want to have. You can target the PC's in the GPO. Basically it would say, if "any user" logs into ANY PC in this OU, map this drive.

You can lock it down to an OU, no bat files, no exposed passwords...done.
0
 

Author Comment

by:asrvwiz
ID: 37798060
Geodash,

Are you saying that I create a GPO and target the PC's I want to map the drive on?  Was not sure that would work?
0
 
LVL 9

Expert Comment

by:Frank McCourry
ID: 37798085
That's how it's done.
0
 
LVL 9

Assisted Solution

by:Geodash
Geodash earned 334 total points
ID: 37798101
It should work. Target the OU that the 2 PC's are in, under your main OU. Assign all users to the policy. When they login to the PC, it should work. To make sure, create 2 new test objects, link them in the same way, and run a RSOP on the objects. This way you can test without moving your PC's until you have fully tested.
0
 

Author Comment

by:asrvwiz
ID: 37800736
Geodash,

I am confused, I do not want to move the PC's out of this OU.  I want users who are a member of a group to map a drive when they log into 2 out of the 15 PC's in that OU.  Do I not have to use loop back processing to do this?
0
 
LVL 9

Assisted Solution

by:Frank McCourry
Frank McCourry earned 166 total points
ID: 37800803
Domain
 |___OU - Where Printers are assigned
        |___OU - Where you will do drive mappings

This will cascade your GPO's ensuring that your Printers are mapped and that the 2 PC's in the subordinate OU will be the only ones to get the GPO that maps the drives
0
 

Author Comment

by:asrvwiz
ID: 37800918
OK I created the GPO targeted a test user and in the security filtering I put the PC, and linked it to the OU.  Is this correct?
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

I had a question today where the user wanted to know how to delete an SSL Certificate, so I thought that I would quickly add this How to! Article for your reference. WHY WOULD YOU WANT TO DELETE A CERTIFICATE? 1. If an incorrect certificate was …
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

860 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