Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • Last Modified:

How do I map a network drive to a computer OU?

Hi all,
I am attempting to map a network drive to about ten computers on our network via GPO.  For reference, the users logging in already have some mapped network drives via a user GPO, but I only want this drive to be accessible on these ten computers.  I am using a drive letter that will not conflict with other existing policies.
I have created a computer OU for the ten machines in question, and linked a GPO to this OU.  The GPO has "User Configuration" disabled, with only "Computer Configuration running.  In the Startup Scripts, I have two files: pushprinterconnections.exe (so we can push out a printer using the GPO) and my .bat file, which looks like this:

@echo off
net use j: "\\server\share name"
exit

When users log on, sometimes they get the network drive, sometimes not.  When they do, it shows up as "Disconnected Network Drive (J:)".  Despite that, the drive can still be opened and files accessed, but this is pretty sloppy, and I need the drive to be accessed properly every time.  I have tried playing with the permissions on the share folder, adding a group composed of the computers in question, but this has not helped.

Interestingly enough, I can rename the "Disconnected Network Drive (J:) to the apppropriate name and it will do so.  I cannot disconnect the drive via GUI or CLI even logged in as Administrator; it says the drive is not in use.  I'm running out of options and could really use some help.  Thanks!
0
ipstech
Asked:
ipstech
  • 3
  • 2
2 Solutions
 
tigermattCommented:
I wouldn't use a Startup Script to map network drives; they are too problematic from my experience with them, and you end up with the behaviour you are seeing.

Perhaps a better method would be to enable User Configuration on this particular GPO, and set the batch file as a User Logon Script. You can then use Loopback Processing (in "Merge" mode) as per http://support.microsoft.com/kb/231287 to ensure that the User section of this particular GPO is actually applied to the Computer object (by default this particular configuration would not work, loopback processing means it can)

-tigermatt
0
 
lscapaCommented:
can you post the following from a client that is not showing the drive?
gpresult /v > gp.txt & gp.txt
 
While tigermatt gave a good workaround that really doesnt resolve the issue.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
ipstechAuthor Commented:
Hi Matt,

I've done loopback policies before, but had hoped to do it through computer policy.  Since I agree with your assessment that it is unreliable, I did as you suggested, and everything works great.  I'm accepting your solution.
0
 
ipstechAuthor Commented:
lscapa,

I like your solution as well, and didn't refresh before posting.  I'm going to accept multiple solutions.
0
 
ipstechAuthor Commented:
Thanks to both of you.  One solution is great as a workaround, and the other provides a good explanation of the original problem that I had been unable to find before, and also gives excellent advice.  Much appreciated.
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!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now