Fix Namespace is already defined errors
The error message Namespace is already defined may be displayed when you open the Group Policy editor on Windows 10, or try to edit an affected policy.
As an example, the following error message was displayed twice when I opened the Group Policy Editor on a Windows 10 machine:
Namespace 'Microsoft.Policies.Sensors.WindowsLocationProvider' is already defined as the target namespace for another file in the store.
File C:\WINDOWS\PolicyDefinitions\Microsoft-Windows-Geolocation-WLPAdm.admx, line 5, column 110
The issue is caused by a name change of a policy in Windows 10 Build 1511. The policy's original name was Microsoft-Windows-Geolocation-WLPAdm.admx in Windows 10 RTM, but has been renamed to LocationProviderADM.admx in Windows 10 Build 1511.
The Group Policy editor detects the namespace conflict, and informs you about it with an error message.
Namespace is already defined
The namespace is already defined error may be thrown on home computer systems that were upgraded from Windows 10 RTM to a newer version such as Windows 10 version 1511.
It may also be an issue on business or enterprise systems if a central store for Group Policy Administrative Template files is used if the conflicting policy was copied to the store.
Fixing the issue
The error message is informational, which means that it can be ignored without ill-effect. The removal depends on whether a central store is being used or not.
Local system, no central store
The solution in this case is to delete the old policy template file on the computer. The error message highlights the path it is stored under: C:\Windows\PolicyDefinitions\
While you can access the folder without experiencing issues, you will notice that you cannot remove the files it contains.
ADMX and ADML files are system protected which means that you cannot rename, move or delete them by default.
You need to add NTFS permissions to the files, and this is done on the command line.
Step 1: Open an elevated command prompt
Tap on the Windows-key, type cmd.exe, hold down Shift and CTRL on the keyboard, and hit enter. Alternatively, right-click on the Command Prompt result and select "run as administrator" from the context menu.
This opens an elevated command prompt which is needed to run the commands.
Step 2: Run commands to add the required permissions
The two commands that you need to execute are:
takeown /F " C:\Windows\PolicyDefinitions\Microsoft-Windows-Geolocation-WLPAdm.admx" /A
takeown /F " C:\Windows\PolicyDefinitions\en-US\Microsoft-Windows-Geolocation-WLPAdm.adml" /A
Note: You may need to replace the \en-US\ part of the second command with another locale. Check the folder C:\Windows\PolicyDefinitions and there the locale subfolder to find out if that is the case.
Windows displays a success message after each command indicating that the file is now "owned by the administrators group.
Step 3: Grant administrators full access
Administrators need full access to the files, and that is handled in this step.
- Open the folder C:\Windows\PolicyDefinitions in File Explorer, and right-click on Microsoft-Windows-Geolocation-WLPAdm.admx.
- Select properties from the context menu.
- Switch to the Security tab.
- Select the edit button when the page opens.
- Select the Administrators group under "group or user names".
- Check the "full control" box under allow.
- Accept the Windows Security message that is displayed.
- Click ok.
Repeat the steps for C:\Windows\PolicyDefinitions\en-US\Microsoft-Windows-Geolocation-WLPAdm.adml. Again, change the en-US locale to the one used on the device if necessary.
Step 4: Rename or delete the file
Use File Explorer to open C:\Windows\PolicyDefinitions and locate the Microsoft-Windows-Geolocation-WLPAdm.admx file in the listing.
You may want to rename the policy template for safekeeping. This is done by right-clicking on it and selecting rename from the context menu.
Replace the file extension from .admx to .old, so that the new filename should read Microsoft-Windows-Geolocation-WLPAdm.old.
Windows may display a prompt on execution that warns you that the file may become unusable if you change its extension.
Select yes since this is intentional. Windows displays a second prompt afterwards stating that you need administrative permissions to rename the file.
Select continue to provide administrative permissions for the file change, and repeat the operation for the second file.
Alternatively, delete the files outright instead of renaming them.
Central Store solution
Do the following to resolve the issue if central store is used.
- Delete the files LocationProviderADM.admx and LocationProviderADM.adml from the central store.
- Rename Microsoft-Windows-Geolocation-WLPAdm.admx as LocationProviderADM.admx.
- Rename Microsoft-Windows-Geolocation-WLPAdm.adml as LocationProviderADM.adml.
Closing Words
The Group Policy should open without errors after making the changes. Please note that the method should work for other namespace conflicts as well. If Microsoft decides to modify names without removing policies for instance, it will resolve those issues as well.
Worked like a charm.
Nice work.
Thank you!
Thanks Martin–I’m hugely impressed at the totally comprehensive solution you’ve given–a lot of work for a silly Microsoft problem. Needless to say I’m now following you on Twitter.
Austin
Can’t thank you enough buddy,that was so annoying to see it everytime really helped.
Yeah – thanks. I figured it wasn’t fatal. But still an annoyance.
Thank you, this has bothered me for a while.
I heard Group Policy corruption are coming from several KB’s I’m unsure because I not use Home/Pro/Preview Windows but this seems never ending problem. Even on a fresh installed and patched system. ^^
Nice guide anyway. Sadly MS somehow can’t fix this once and for all. I only can imagine that such stuff is annoying.
Thats a lot of work for solving the issue…………
TYVM, I stumbled upon this warning once in a while, but since it’s warning I didn’t care enough to investigate.
Now I know Microsoft sometimes renames files and doesn’t care enough to remove old ones.