0

I have a .bat file which is

net use z: \\....

to map network drive, and tested it with no problem under win xp

Then I try to put that as "startup script" under GPO (which is managed by 2k8 AD) -> Computer -> Policies -> Windows. After restarting computer, the script should be executed (I checked gpresult and the script is there), but the drive is not mounted. Any one have idea on what's happening ?

Ben Pilbrow
  • 12,041
  • 5
  • 36
  • 57
xandy
  • 105
  • 1
  • 1
  • 4

5 Answers5

7

You should be using User Configuration > Windows Settings > Scripts > Logon

You are mapping the the drive using the 'computer user account' rather than the users own account.

Edit: You could also use the new Group Policy Preferences in 2K8 to map a drive ( make sure you have the Group Policy Client Side Extensions installed on the machines you want apply the policy to)

JS.
  • 3,901
  • 22
  • 18
  • Also, bear in mind that if you go the logon script route and are logged-on as an "Administrator" the "drive" still won't be available once Explorer starts. See: http://serverfault.com/questions/63738/networkmapping-script-vbs-vista-doesnt-work-xp-does/63756#63756 – Evan Anderson Sep 25 '09 at 12:43
  • Good point, thx. My script is not working before coz my XP client havent installed the KB943729. – xandy Sep 28 '09 at 07:52
0

I tried logon script, local GP few other methods but got strange results, the mapped drive would appear as disconnected when I log on. I tested with a batch file to write or read from the supposed mapped drive without logging on and none succeed. I cannot get rid of the disconnected mapped drive either!

I used MKLINK and this works perfectly without any issue and non profile dependent. this would create a soft link to your remote share via UNC and appears as a folder on your local drive everytime. I use this to share a remote UNC share for 2 servers sharing a config file for an application. I hope this works for you.

mklink /D (comment: /D is for symbolic link, /H is a hardlink if your UNC is local drive) link-target

for example:

mklink /D c:\SHARED_folder \\fileserver1\FOLDER_TOBE_SHARED
slm
  • 7,615
  • 16
  • 56
  • 76
  • the task scheduler is also supposed to work in this scenario to map a drive at startup but i ran into permission problem even if the mapdrive batch file is ran under an admin account – Thai Quach Jun 20 '13 at 07:29
0

If it's running as a startup script the computer account will need permissions to the network share, which I'm guessing it doesn't have. You need to set it as a logon script instead unless the former is your desired behaviour.

Maximus Minimus
  • 8,987
  • 2
  • 23
  • 36
0

This site has a decent list of working logon scripts and bruteforce logon scripts that could help you out, there is also further detail on how to implement them through gpo. Logon Scripts Site

Anicho
  • 285
  • 2
  • 5
  • 11
0

Go to this site For mapping Network Drives using VB Script. : http://www.computerperformance.co.uk/Logon/Logon_HomeDir.htm

This helps if you have to use User Authentication aswell. And it seems you have a user Permission issue, so this should help you out.

I had the same problem a while back and got hold of that site(Will not let that site go either).