All about Drive mapping in Group Policy Preferences

by Sitaram Pamarthi on January 8, 2010

 I had spent real huge amount of time in dealing with drive mapping in Group Policy preferences in last week. It’s easy as you see, but very difficult when you want to troubleshooting. So, I decided to write this post to help my blog visitors by providing as much as information I have gathered/learnt in Drive mapping related things. 

As said before, things are really smooth when you configure drive mapping preference for the first time.  If you start playing with it to satisfy different kind of situations, then you are caught.  What I did to make my life tough is, I deleted the mapped drives after login and did a “gpupdate /force” no drives were mapped L. Again, what I did is, I re-logged into the machine and found that they are not in place still. I surprised and made relogin again, this time they mapped. Finally after applying multiple tests like this, I came to a conclusion that, I have below two problems… 

  1. Drive mapping is not happening at every attempt
  2. Background processing of drive mapping is not working

 The very big mistake I did to resolve above is, trying to resolve both the problems at same attempt and really mixed up the things and made myself confused.  After taking a break, I followed the divide and conquer method. 

Problem#1: Drive mapping not happening at every login

Initially I am not sure why the drive mapping is not happening at every login. I ran rsop and there drive mapping processing time is not updated. This made me to realize that drive mapping CSE didn’t triggered at all. Well, now I enabled GPO debug logging on my Windows 7 machine and started looking at the logs. They are clearly saying that drive mapping CSE processing skipped as there is no change in version number. Hmm, whatever it is doing is right and I have enabled “Process even if the Group Policy objects have not changed” option in “Drive maps preference extension policy processing” policy which is located at [Computer Configuration | Policies | Administrative Templates | System | Group Policy] and restarted my PC. Things started working and drive mapping is happening every time I re-login.

First problem is solved. Let’s move on to the second problem.

Problem#2: Background processing of drive mapping is not working.

After login, if I delete mapped drives and initiate a “gpupdate /force” command, my drives are not coming back. I again relied on GPO logs and realized that drive mapping CSE refresh is happening as part of background processing. I STRONGLY recommend to not to follow the description of Drive mapping CSE; it is really contradicting with its behavior. As per the policy description, drive mapping refresh should work during the background processing by default — but it is not the case. Now I went to the registry key, HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogonGPExtensions{5794DAFD-BE60-433f-88A2-1A31939AC01F} and changed the value of “NoBackgroundPolicy” to “0”. This did the trick and background refresh of drive mapping started working fine.

Hurry…I resolved both my problems and trying to figure out a new problem I observed just now.  I will blog it as soon as I resolve it. 

To Summarize:

How to make GPO to process Drive mapping at every login:

  1. Edit the GPO which is applicable to your computers and navigate to [Computer Configuration | Policies | Administrative Templates | System | Group Policy]
  2. Now go the properties of “Drive maps preference extension policy processing” policy and enable the option “Process even if the Group Policy objects have not changed”
  3. Save you GPO and reboot your machine

 How to enable background processing for drive mapping CSE:

  1. Go to regedit and navigate to HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogonGPExtensions{5794DAFD-BE60-433f-88A2-1A31939AC01F}
  2. Locate “NoBackgroundPolicy” value and change it to “0” from “1”
  3. Now try doing a background refresh by issuing the command “gpupdate /force” and it should work

Thanks for reading the log story and happy learning,
Sitaram Pamarthi

This post was written by...

– who has written 465 posts on Techibee.com.

Sitaram Pamarthi is a windows administrators with 9+ years of experience.read more

{ 35 comments… read them below or add one }

how to fix dll errors April 17, 2010 at 3:35 pm

Sooooooo awesome post, i adore some words so much and can i quote a couple of of those on my blog? I also have emailed you relating to is it possible for us to exchange our links, hope talking with you soon.

Reply

Chris December 14, 2010 at 1:59 am

I dont see…

“Drive maps preference extension policy processing”

I am running Windows 2008 R2 domain controllers and my domain level is Windows 2008 R2 native.

Reply

Sitaram Pamarthi December 14, 2010 at 12:24 pm

Chris, Make sure that you are editing your “Domain Policies” from a computer which is running either windows 7 or windows 2008 R2 Operating system. You should be able to see this. Let me know if you face any trouble.

Reply

Chris December 14, 2010 at 8:15 pm

@Sitaram Pamarthi
I sent you an email with a screen shot. I am running RSAT from a Windows 7 64bit Pro PC that is joined to the same domain. I have full rights to everything.

I am wondering if they moved this in 2008 R2? I searched high and low yesterday to find any refrence to it.

Thanks!
-Chris

Reply

Sitaram Pamarthi December 14, 2010 at 9:30 pm

Thanks for the screen-shots.

I think I understood the problem. EPGDIT in your computer is picking the ADMX files from a central store(see this message next after to Administrative templates folder) where Group Policy Preferences.ADMX and ADML files are not available. Hence you are not able to see these GPP debug options.

Solution:

Solution here is to down and install “Administrative templates(ADMX) files for windows 2008“. After installation go to installation folder, locate “GroupPolicyPreferences.admx” file and copy to the central store where you are managing all your ADMX files. After that EDIT your GPO again and you should see them.

Hope this helps.

Reply

Chris December 14, 2010 at 10:19 pm

@Sitaram Pamarthi

That worked great thanks much! I see that option plus more.

-Chris

Reply

sessions January 7, 2011 at 9:39 pm

Does the registry setting for enabling background processing need to be pushed to all workstations?

Reply

Sitaram Pamarthi January 7, 2011 at 11:44 pm

Yes. It should be pushed to all computers on which you want to enable background processing.

Reply

GD August 11, 2011 at 7:55 pm

does the group policy refresh in your environment every x mins/hrs?
if you change “NoBackgroundPolicy” = 0
does it disconnect the drive and reconnect when the group policy refreshes?

Reply

Sitaram Pamarthi August 12, 2011 at 7:37 pm

GD, If you have background refresh enabled for DriveMapping, it will check if drives are mapped and only will try to map them if they are not found. You can enable GPP debug logging if you want to see what exactly happening.

Reply

Rohit October 26, 2011 at 3:03 am

Is there any way where I can create a drive and give the name as %username% automatically when I create a new User?

Reply

Sitaram Pamarthi October 27, 2011 at 11:47 am

You mean mapping a drive and naming it as %username%? Can you give some more details for clear understanding of the requirement?

Reply

Jerame October 27, 2011 at 6:00 am

Hi Sitaram,
I’m running Windows 7, and am getting the Cannot edit NoBackgroundPolicy: Error writing the value’s new contents.

I am a local admin, and even with turning UAC off, and running regedit as an administrator (I know, shouldn’t need to with UAC turned off), I am still getting the error. Seems like a registry permissions thing. Have you come across this? I’m not seeing much about it on the internet.

Thanks for your post, it’s been very insightful!
Jerame

Reply

Sitaram Pamarthi October 28, 2011 at 9:46 pm

No. I never came across this kind of thing. Just to eliminate UAC suspections, open a command prompt in elevated mode and start regedit from that window and try your modifications again. If you suspect the permissions issues, just cross verify the permissions of that regkey with a working PC. Thanks for your comments.

Reply

Varun December 28, 2013 at 12:19 am

You have to take an ownership of GPExtension as System is the owner by default. You should be able to change them once you take ownership.

Reply

JD December 1, 2011 at 4:00 am

Hi,

I have been playing around with this and get this to work nicely on a Windows XP machine, where I can run gpupdate and the drives reappear in Explorer. Running this on Windows 7 and the drives don’t appear in explorer but when you run a “net use” they are shown but their status is listed as unavailable.

It has me completely bamboozled, have done numerous searching but can’t find where the issue may lie. I have even turned off UAC to see if that could be it, but doesn’t look like it. Any ideas?

Reply

JD December 1, 2011 at 5:00 am

UPDATE: I have now followed the instructions in http://support.microsoft.com/kb/937624 and this means that the drive will remap as OK (not unavailable), but still not show in Explorer. ?? Very puzzling.

Reply

JD December 1, 2011 at 8:01 am

UPDATE 2: Have discovered that by killing and restarting explorer.exe that this then shows the drives. No idea why it doesn’t automatically update.

Reply

Sitaram Pamarthi December 1, 2011 at 8:41 am

JD, AFAIK, explorer will have some refresh interval after which it might show the drives in explorer. And like you said, the explorer restart also works — but not a viable solution.

While I was working on GPP, I explored too much about this. Looks like some Windows API has function to refresh explorer which may reload the mapped drives. You may want to continue your research in that direction to find a workaround to your problem.

Reply

JD December 2, 2011 at 7:21 am

Good idea on the API and a quick Google found this, which … doesn’t work http://powershell.com/cs/media/p/8322.aspx. Interesting that explorer.exe updates in XP and not 7 though.

Reply

Fred December 8, 2011 at 2:21 am

Regarding the fix ti edit the reg key 1.Go to regedit and navigate to HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogonGPExtensions{5794DAFD-BE60-433f-88A2-1A31939AC01F}

This works fine but local admin has to take ownership first then change permission to give the hability to set the value to “0″

Now, do you have an idea to deploy this to 4000+ workstation????? Pushing the value with GPO I’m ok but what about taking Ownership prior…..???

Thanks!!!

Reply

Sitaram Pamarthi December 8, 2011 at 7:53 am

I guess you can deploy it with group policies as GPOs processing will be done with SYSTEM account which has FULL access on the registry key that we are referring here.

Let us know if you face any trouble in doing that.

Reply

Fred December 8, 2011 at 10:00 pm

Works like a charm… Only problem and for now there’s no viable resolution is Explorer.exe does not refresh but the map shows up using Net use command. So a quick logoff login as the workarround. thanks

Reply

Breeze December 14, 2011 at 11:02 am

Deploy registry settings through GPO/Preferences/Windows Settings/Registry , it works.

Reply

Sitaram Pamarthi December 9, 2011 at 2:17 pm

Fred,

Yes, relogin will work. There are two more options available to make explorer recognize the drives without re-login.

1) Restart the explorer process — I know it is a bad option but works.
2) Implement the Explorer Refresh Script that JD mentioned in the comments section. — Looks like is has some compatibility issues with Windows 7 but can be figure out.

Hope this help..!!

Reply

Breeze December 14, 2011 at 11:00 am

Dear Sitaram,
thanks for sharing knowledge, deployment through GPO/Preferences/Windows Settings/Registry works fine, its ok, i have tested & implemented it. Further only this registry change have also solved my 1st problem (re-connect network drive after log on/log off).

One more thing required your kind attention that on Server 2k3 my log-on scripts (in *.bat format) works fine, but when I put them in server 2k8-R2/User-Properties/Profile/Logon scripts they don’t run. These *.bat files are in \sysvol\domain-name\scripts folder and are also visible in \netlogon\ & are accessable on each client and even I can run them manually.

Thanks in advance & best regards.

Reply

Sitaram Pamarthi December 14, 2011 at 11:24 am

Breeze, are you seeing the logon scripts in RSOP output when ran from any windows 2008 server?

Reply

Jasen Webster January 7, 2012 at 1:34 am

You can also place the NoBackgroundPolicy DWORD value under the [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Group Policy\{5794DAFD-BE60-433f-88A2-1A31939AC01F}] key and it works, overriding the other registry setting mentioned in this article.

This leaves me wondering why MS left this option out of the Drive Maps Policy Processing policy, since the other 3 options exist under this policy key as well.

Reply

ChrisSPS February 19, 2012 at 11:31 pm

Has anyone come up with a solution regarding the need to restart explorer.exe on Windows 7 to make mapped drives appear in Explorer after gpupdate or background policy refresh is performed?

Reply

mourb April 25, 2012 at 8:47 pm

Hey guys,

@ChrisSPS
I found the solution! Open the Folder Options. Select the Launch folder windows in a separate process check box, and then click OK. All mapped drives appear now in every new explorer window after ‘gpupdate’. You dont need to logoff. If you want to use ‘gpupdate /force’, answer no.

I am not sure about the background policy refresh.

best regards from germany
mourb

Reply

Gareth May 5, 2012 at 5:25 pm

Nothing here worked for me.
Windows 2008

Reply

Gareth May 5, 2012 at 6:25 pm

Update: Found that instead of Create, I specified Recreate under Preferences/Drive Maps and now all servers and workstations seem to map correctly. Verification will come on Monday with un-touched machines that need to update the GPO first time.

Reply

Matt September 27, 2012 at 5:59 pm

Tried the drive map – enabled all settings on this post – added in “Always wait for network” gpo setting as well as the tracing. No drives show and there are no errors in the tracing log. Extremely frustrating!!!

I’ve tried create, update and replace for the drive map settings…. can’t get it to show anything!!! both the tracing log and the event log show that settings were applied successfully… I can do a net use and have it map fine, just not in GPP.

Reply

Carla November 21, 2012 at 8:31 pm

I have an issue where the mapped drive needs the password prepopulated. That prepopulated password is the users login name. How can I prepopulate the password and confirm password with the users’ login name for the password?

Reply

Mirco December 19, 2012 at 8:58 pm

Hi Sitaram

I am experiencing recently a strange issue. Suddenly (1 week ago) all my GPPs drives & printers mapping don’t work under a specific OU.
My domain is a w2k3 native, but now I had several w2k8r2 DC running correctly. If I try a “report group policy” or a “modeling group policy” for a user/workstation, if the report or the modeling runs under a w2k8 DC everything is fine, if it runs (and by default is so) under the last w2k3 DC all the GPPs fail

I try to force to inherit policies from a w2k8 DC…I install the GPP client side extension in the w2k3 DC but nothing to do… :(

May you help me ?

Thank you very much!

Reply

Leave a Comment

{ 3 trackbacks }

Previous post:

Next post: