We have a Windows 2008 R2 file server sharing home folders for about 600 users. These folders are mapped to a shared drive for each user when they log in on their own workstations, and that mapped drive is in turn set as the default location in the Documents library in windows on everyone's profile, including the default profile on each of our machines. Log in to a new machine for the first time, and your Documents library will point at the file server. For laptop users, we also use the Offline Files feature, so that this follows them even when they're away from work.
My problem is that, looking at these folders on the server, they all show up in Explorer as "My Documents", instead of the actual folder name (set to match the username). How can I prevent Windows Explorer from doing this?
There's a much easier method, non-destructive, which targets the actual Desktop.ini entry responsible for this behaviour. Go to:
Group Policy -> User Configuration -> Preferences -> Windows Settings -> Ini Files
Create a new Ini File entry, with the following settings:
Action: Delete
File Path: %homeshare%\desktop.ini
Section Name: .ShellClassInfo
Property Name: LocalizedResourceName
MAKE SURE you enable Run in logged-on user's context under the Common tab.
This will remove the offending line from the user's desktop.ini folder, fixing the folder display name behaviour, and leaving everything else intact, including any other user-set folder view customisations, etc. No mess, no fuss.
(From Spiceworks)
You then get an extra column showing the real filename. You could make this the default for folders by doing this.
This is Explorer interpreting the
desktop.ini
files located in each folder. It's maddening and unhelpful, and Microsoft recognizes that but gives no useful advice. The old "This behavior is by design" excuse for the loss...I've taken to restructuring my shared directory hierarchies, on new installs, to be user-centric rather than directory-type-centric. Rather than having a hierarchy of "Documents" directories and "Profiles" directories (Desktop" directories, etc), I've taken to making a subdirectory for each user, and subdirectories below that for their various directories, like:
I am really liking this method better tan the old way. I particularly like my provisioning script can set one ACL, at the "Bob" directory, versus one at each directory when they were stored in their own hierarchy. It also makes seeing an individual's total space usage much easier because I only need to
du
one directory.My folder redirection policies need to change a little, as do the user profile paths (ending in
%username%\Profile
rather than just%username%
), but it's a minor change. I've only been doing this for a few months but, so far, it has worked well.Deny yourself (or your security group) read access to the desktop.ini - Next time you refresh the folder, it will show the actual folder names, not "My Documents"
Just delete desktop.ini from all user folders (subdirectories of the share). I tested this, and it instantly displayed the proper name.
desktop.ini is hidden by default which makes it a little more tricky, but I can't see anything the users would miss with it gone; There is all of three lines of information in there.
Edit: To quickly blow away all desktop.ini files from the entire shared folder structure use the following command: (WARNING: This WILL remove user customizations for their folders, icons, layout settings? etc.)
To 'quick fix' this (this will instantly give them back their names, but if you do not set a new ini policy as suggested by Uthacalthing when a user logs in it will reform), use CMD or Powershell to either remove the desktop.ini file or rename it to something else.
Change the ACL permissions to deny Administrators Read Access to the file in this folder and subfolders. You may have to run it again after adding new users.
I used the below command in a Command Window. You should run as Administrator.
icacls "P:\users\desktop.ini" /deny Administrators:R /T /C
Add the column 'Filename' in explorer and you see the usernames