User folder displayed as “Documents”: Remove desktop.ini

A users’ folder is displayed as “Documents” and you don’t want that.

To e.g. remove desktop.ini files (which are hidden: use -force):

Get-ChildItem "\\SERVER\d$\Users\Userdata\" -recurse -filter desktop.ini -force | foreach ($_) {remove-item $_.fullname -force}

This deletes all the desktop.ini files and will help you see the normal folder structure.
It may be nasty for the users.. or not. Up to you.

Found at http://www.kevin-burke.co.uk/windows-server-technologies/home-folder-shows-documents-folder/

 

Hope this helps you!

This entry was posted in File sharing, powershell. Bookmark the permalink.