GPO for drive mapping won't work with %LogonUser% in location field

14,876

Solution 1

1) Definitely use %USERNAME%

2) Do the users definitely have the right NTFS and / or Share (Remember, they're different) permissions over that folder

3) What happens if you disable "Run in users security context" (I've never had to use this for user drive mappings)

4) Finally, I always explicitly select "Show / Hide this drive" rather than leave it at "No Change" unless there's some specific reason not to. (Though I doubt that's related given your Event Log entries)

Solution 2

You must set the GPO to create the folder using the variable first, then you can map drive using the same variable. In the GP it's User Configuration - Preferences - Folders set it to "update" a folder using the same path as you tried to map (\server\folder\users\%username% works for me) for attributes I unchecked all boxes, then on the common tab I checked "Run in logged-on user's.." "Apply once and do not reapply" and "Item-level Targeting" I don't think you really need targeting if you don't want to use it.

After that try and map your drive using the same variable (%username%) and it should work just fine.

You can do both functions in the same GPO.

Share:
14,876

Related videos on Youtube

CokoBWare
Author by

CokoBWare

Updated on September 18, 2022

Comments

  • CokoBWare
    CokoBWare almost 2 years

    I'm struggling with a problematic drive mapping user preference where I'm trying to use the user's %LogonUser% variable to a network location (eg. \server\folder\users\%LogonUser%), but the drive mapping fails to appear after logging off and logging back in. All clients are either using Windows 2k8 server or Windows 7 Pro.

    The GPO is linked, and is the last in the Linked Group Policy Objects list.

    The drive mapping XML is below:

    <Drive clsid="{935D1B74-9CB8-4e3c-9914-7DD559B7A417}" name="P:" status="P:" image="1" changed="2011-09-19 15:07:49" uid="{1FB4CF18-0876-4152-B24B-83FF36E5A4D5}" userContext="1" bypassErrors="1">
      <Properties action="R" thisDrive="NOCHANGE" allDrives="NOCHANGE" userName="" path="\\servername\folder\Users\%LogonUser%" label="" persistent="1" useLetter="1" letter="P" /> 
    <Filters>
      <FilterGroup bool="AND" not="0" name="MYDOMAIN\Domain Users" sid="S-1-5-21-1060291529-3284457842-1331950329-513" userContext="1" primaryGroup="0" localGroup="0" /> 
      </Filters>
      </Drive>
    

    Does anyone have any thoughts as to why this wouldn't be working? I've checked the Windows Application Event log, and I can't find anything to help me diagnose the issue. Anyone have any insight into the cause, or any suggestions as to what I should try in order to diagnose the problem?

    • joeqwerty
      joeqwerty almost 13 years
      You should look in the Group Policy event log.
    • CokoBWare
      CokoBWare almost 13 years
      Tried %username% - didn't work.
    • CokoBWare
      CokoBWare almost 13 years
      Re: Group Policy event log - I'm getting an access denied message The user 'P:' preference item in the 'NAS - Peronsal User Drive Mapping {12EB8111-1517-43D2-A5C0-9C4CF5E1C099}' Group Policy object did not apply because it failed with error code '0x80070005 Access is denied.' This error was suppressed.