Tag Archives: Mandatory Profile

Libraries in Server 2008 R2 mandatory profiles.

Love them or hate them, the new library system Microsoft has included in Windows Vista and later operating systems are here to stay. But when you start provisioning mandatory profiles in server 2008, you quickly begin to see issues with these static file mappings.

Bear in mind with libraries, there are no group policys  to control what is populated in a library. You can control which libraries are created, but you cannot by default control what goes into them.

Shared local folders in the enterprise:

The first issue to be found with libraries are their default locations, for each respective library it contains the users personal folder and a shared folder accessible by all on the local machine.

This shared folder may serve a good purpose in the home, with multiple family members sharing a pc and wanting to share music and pictures, but in the enterprise shared folders on a shared system require maintenance. Worse yet, if you are sharing hosted desktops with other departments / customers this is where data may fall into the wrong hands.

Static mappings from the mandatory profile:

After the initial login, if the user browses directly to the contents of the library contents without first opening the parent library, they will often receive the following error:

The user we see above, manny, was the name of my mandatory profile creating account. If you browse to the parent before entering your documents folder, windows is clever enough to rectify the issue without giving an error.

But alas, despite following the best practices available on-line we’ve some how ended up with a static mapping, how annoying.

To get to the crux of the issue, we need to know more about these libraries.

So what is a library? 

A library, is a collection of indexed* directories, allowing you to view the contents of multiple folders in a single view. They have more cool features, but lets leave it as that for the moment.

* libraries will allow un-indexed directories to be mapped if part of a group policy, but it will complain about the source not being indexed.

A library is a text document, stored in %appdata%Microsoftwindowslibraries. These files have the file extension of .library-ms. The contents of the file can be opened with a text editor as its XML based.

When i opened my mandatory profile’s documents.ms-library file, below you can see the contents:

As you can see above, the library contains the user’s sid and the following default locations are listed under the <URL> tag. To compare a known folder’s GUID to a  folder, check the following site provided by Microsoft for reference. In the case of the documents Library here are the locations that are in there by default:

{FDD39AD0-238F-46AF-ADB4-6C85480369C7} = Documents

{ED4824AF-DCE4-45A8-81E2-FC7965083634} = PublicDocuments

Note the Serialized string also, this seems to be a static mapping to the folder in question.

So how do we fix this?

Well, that’s a two part answer. If you decide you are happy that the public documents folder will be displayed to all users in their documents library, simply delete the libraries from the mandatory profile, this will cause the libraries to be recreated each time they login, resolving the static mapping error above.

If you want to remove the public folders, you first need to modify the library file in question in the mandatory profile and remove the public documents. To remove the public folder, simply remove the <searchconnectordescription> value containing the public folder in question. In the case of the documents library above you would remove the following:

This will get rid of the public folder in the library, to remove the static mapping, remove the usersid section, along with the serialized section. The finished result is below for reference:

Saving the above file in your mandatory profile will correctly provision the documents folder without a shared folder or incorrect mapping. This practice can also be applied to the remaining libraries.