none
Windows Server 2008 using GPO to map network drives

    Question

  • An outside firm used GPO that called a VB script to map a network drive during logon. 

    A look at the C:WindowsSYSVOLdomainscriptsNetwork Drive logon scripts shows

    Set objNetwork = CreateObject("WScript.Network")
    objNetwork.MapNetworkDrive "Z:" , "1-SRVFPublic"

    The VB scripted worked fine for Windows XP computer. Why does this script not work for Windows 7 computer?

    The suggestions on the Internet are to use Group Policy Preference to map the network drives. The problem I had is I can not seem to browse (location) to the folder I want to share. I only seem to see a subset of the Active Directory Users and Computers. How can I browse to the folder I want to share?

    Is the network drive mapping via GPO different in Windows Server 2008 compared to Windows Server 2008 R2?

     

    Thursday, May 06, 2010 6:02 AM

Answers

All replies

  • I assume that it's an error that your script looks like: objNetwork.MapNetworkDrive "Z:" , "1-SRVFPublic"
    I assume it should be: objNetwork.MapNetworkDrive "Z:", "\\1-SRV\Public"

    The above script should work on Windows 7.

    It sounds strange that you can't browse to the folder you are attempting to share. This could be a permission issue.

    I have tried using Group Policy Preferences to map network drives and it works fine, it actually seems to do it quicker than regular "Net use" and VB script.


    /Lasse
    Thursday, May 06, 2010 8:15 AM
  • Hi Techcoor,

    I have tested on my windows server 2008 R2 and windows 7, the logon script of map network drive also didn't work, but when I went to configure as following steps, the issue was solved.

    To configure the EnableLinkedConnections registry value, follow these steps:

    1. Click Start, type regedit in the Start Search box, and then press ENTER.
    2. Locate and then right-click the following registry subkey:
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
    3. Point to New, and then click DWORD Value.
    4. Type EnableLinkedConnections, and then press ENTER.
    5. Right-click EnableLinkedConnections, and then click Modify.
    6. In the Value data box, type 1, and then click OK.
    7. Exit Registry Editor, and then restart the computer.

    For more information on turn off User Account Control in Windows Vista/7, please refer to:
    http://support.microsoft.com/kb/937624/en-us

    Friday, May 07, 2010 3:28 AM
  • However, the reference also states Important This workaround may make your system unsafe. Microsoft does not support this workaround. Use this workaround at your own risk.  So this does not look like the best fix.
    Saturday, May 08, 2010 5:48 AM
  • Not sure why I could not cut and paste however the actual script is:

    Set objNetwork = CreateObject("WScript.Network")
    objNetwork.MapNetworkDrive "Z:" , "\\1-SRVF\Public" So there isn't a problem there.

    You said the reason I can not browse may be a permission issue. I decided to log in using the builtin administrator (not sure which type of administrator this account is) and had the same problem.

    If I go into group policy management editor, user configuration, preferences, windows settings, drive maps, edit, properties, the browse button is on the same line as Location:. Therefore, I expect when I browse to be able to go to a folder location like \\servername\test. Instead I am seeing the domain name and under that the OUs. I am not sure why I am looking at OUs when I am looking for folders.

    Saturday, May 08, 2010 6:04 AM
  • Hi Techcoor,

    Please refer to the link below:

    Using Group Policy Preferences to Map Drives Based on Group Membership

    http://blogs.technet.com/askds/archive/2009/01/07/using-group-policy-preferences-to-map-drives-based-on-group-membership.aspx

     

    Monday, May 10, 2010 1:26 AM
  • Let me take http://blogs.technet.com/askds/archive/2009/01/07/using-group-policy-preferences-to-map-drives-based-on-group-membership.aspx and look at Figure 1 Configurating mapped drive preference item. Reading across from Location: there is \\hq-con-srv-01\data and the next item is a button with ... What is the purpose of the ... and how does that button figure into the network share mapping? 

    The document description of the Targeting apparently skips a step. It probably should read something like "We can configure item level targeting by checking the item-level targeting then clicking the Targeting button, which is located on the Common tab of the drive mapping item."

     

    Tuesday, May 11, 2010 2:52 AM
  • I assume that the "..." button is to search for the share through your AD. I have just tried using it to find a share on one of our servers, but I can't get it to find anything. I have always entered the share manually and it works perfectly.

    You are correct regarding the missing step regarding item-level targeting, but it's pretty much straightforward.

    If you want to use GPP I would recommend that you enable logging on the client computers. Take a look at this link:
    http://blogs.technet.com/askds/archive/2008/07/18/enabling-group-policy-preferences-debug-logging-using-the-rsat.aspx

     


    /Lasse
    Tuesday, May 11, 2010 6:49 AM
  • Can you tell me which Windows OS work with this command? I assume Windows XP through Windows 7.
    Tuesday, May 11, 2010 5:37 PM
  • You are correct. From Windows XP with the Client Side Extensions for Group Policy Preferences to Windows 7. As far as I remember Vista needs to have Service Pack 1 to run with GPP, but I am not sure.

    http://www.microsoft.com/downloads/details.aspx?FamilyID=e60b5c8f-d7dc-4b27-a261-247ce3f6c4f8&displaylang=en

    http://www.microsoft.com/downloads/details.aspx?FamilyID=ab60dc87-884c-46d5-82cd-f3c299dac7cc&displaylang=en


    /Lasse
    • Marked as answer by techcoor Tuesday, May 18, 2010 11:09 PM
    Tuesday, May 11, 2010 5:43 PM
  • Still can’t quite seem to get network mapping using Group Policy Preferences to work.

     

    I created on the Windows Server 2008 a folder called test. I shared the folder using the advanced sharing.

     

    I created a Group Policy test and linked it to the technical OU. I rechecked Group Policy test and see I have Show this drive, Drive Letter X, Reconnect, location \\server\test, action Create under general tab. On common is Item-level Targeting. Clicking the Targeting button gives Group Domain Name\technical, User in group.

     

    I downloaded the Group Policy Preference Client Side Extensions for Windows XP and ran it on the Windows XP computer.

     

    I did gpupdate /force on the Windows Server 2008 and then on the Windows XP computer.

     

    I open Windows XP my computer and do not see the share drive X. What else do I need to do?

     

    Wednesday, May 12, 2010 3:12 AM
  • First of all, you should run gpresult on the Windows XP to see if the policy is actually deployed to the user.

    You could also enable the logging, as I wrote earlier. After doing so, you will get information regarding Group Policy Preferences in the Event Viewer under Program
    In your case I would enable "Drive Maps Policy processing" and set event logging to "Informational, Warnings and Errors". By doing so you will get entries in Event Viewer, when you login or do a gpupdate, regarding the drive mappings.

    I just did a test. I created a GP with a drive map to a share on one of our servers, I then did a gpupdate /force on my notebook and I could see through gpresult that the policy was applied, but I didn't get the mapped drive. I then did a log off and log on and then the share appeared and if you have the logging enabled you will see an entry in the Event Viewer.

    I hope this helps!


    /Lasse
    Wednesday, May 12, 2010 7:05 AM
  • The Windows XP gpresults looked OK.

     I did the Applied Group Policy Objects. Does show the user is a part of the following security groups Technical on the Windows Server 2008 and did not notice anything in the windows program log

    Apparently I was suppose to add the capability to the Windows XP computer. The reference only covered Vista so I do not know the procedure for Windows XP

     

     

     

     

    • Edited by techcoor Thursday, May 13, 2010 6:17 AM Added instead of another entry
    Thursday, May 13, 2010 5:19 AM
  • Hi,

    If there is any update on this issue, please feel free to let us know.

    Thursday, May 13, 2010 6:27 AM
  • To get the Group Policy Preferences to work on Windows XP you just need Service Pack 3 and the following patch:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=e60b5c8f-d7dc-4b27-a261-247ce3f6c4f8&displaylang=en

    If you are running with Service Pack 3 and have the Client Side Extensions installed, then it should work.

    Are you using using Item-level Targeting or have you changed the target users from Authenticated Users to the Technical security group?

    Have you enabled the logging? If you have enabled logging and you have Service Pack 3 and Client Side Extensions installed then you should get entries in Event Viewer\Program.

    If it was me, I would create 2 new Group Policies. One GP that enables the logging and one that maps the drive without doing anything regarding item-level targeting or group membership.


    /Lasse
    • Marked as answer by techcoor Tuesday, May 18, 2010 11:08 PM
    Thursday, May 13, 2010 12:37 PM
  • Yes, I did check Windows XP control panel system and see service pack 3. Yes, I did run Group Policy Preference Client Side Extensions for Windows XP a second time. I do see the test group policy being applied and I do see the correct security group technical with gpresult. It appears the Windows XP is set up correctly.

     

    I am not following about the logging.  A reference was given to http://blogs.technet.com/askds/archive/2008/07/18/enabling-group-policy-preferences-debug-logging-using-the-rsat.aspx  When that reference was used, the statement was to enable logging on the client computers.   The reference only talks about Windows Server 2008 and Vista. It does not talk about Windows XP. If I run gpedit.msc on the Windows XP computer, I do not see an entry for Drive Map Policy Processing and do not know if I should be enabling something else.

     

    I did enable Drive Map Policy Processing with the test group policy but did not see anything in the server Windows log.

     

    I did check Item-level targeting, selected targeting and see the user is a member of the security group domain name\Technical  

     

    I am looking at an OU structure done by someone else that doesn’t look quite right. There are folders on the server. The folders access is controlled by a security group. What isn’t making sense is that there is an OU for each of the security groups which with one exception executive seem to be taking up space. Top OU structure for discussion is called management. Under management, there is an executive OU for those that get extra network shares and a printer. The users are either in management or executive. The VB GP is applied at the management level for network shares for everyone. The VB GPs are applied at executive level for those network shares only for executive users. The printers are deployed in like manner. The new test GPO was put at the management level.

     

    I will try the 2 group policies later.

    Thursday, May 13, 2010 4:23 PM
  • Hi

    It sounds a bit strange that it isn't working.

    The logging is for the client computer, so after enabling it, you should get information in the Event Viewer under Program on the client computer!


    /Lasse
    Tuesday, May 18, 2010 6:17 AM
  • What Lasse had stated was quite correct. However, I found a new way to trip. The location I had was \\...svrf.... The correct path was \\...srvf.... I had someone remote in and discovered this problem.

    • Marked as answer by techcoor Tuesday, May 18, 2010 11:08 PM
    Tuesday, May 18, 2010 11:08 PM
  • I had marked a solution. Actually, the drive map only worked every other logon. There was one more changed needed. See

    http://social.technet.microsoft.com/forums/en-US/winserverGP/thread/e660254d-cf13-48dd-8487-c696d6eed970

    Friday, May 21, 2010 2:16 AM