Solved

Map drive for any user that logs into a pc

Posted on 2012-04-02
16
336 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 8

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
 

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 8

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
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 8

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 8

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 8

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Recently, I was asked to look into SCCM 2007 by my employer, having a degree of experience of earlier versions of SMS and some previous SCCM knowledge I didn't expect the procedure to involve to much time. I read a number of guides concerning it…
I was asked if I could set up a fax machine so that incoming faxes were delivered to people's Exchange inboxes and so that they could send faxes from their desktops without needing to print the document first.  I knew it was possible but I had no id…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now