I want to accomplish the following task: A user must not have rights to save on their Desktop, My Documents, My Music, My Videos, My Pictures, etc.
I have already prevented and hidden all drives via GPO. However, user are still able to store files in the locations listed above.
Server OS: Windows Server 2008 R2
Client OS: Windows XP, Windows Vista and Windows 7
It's very easy if you are using Windows Server 2008.
Computer Configuration
>Policy
>Windows Settings
>Security Settings
>File System
%userprofile%\Desktop
....etc for the different folders that you want to restrict access to.This is possible with a logon script, but it's a bit tricky, and would require testing to ensure that it works correctly for the target environment. It makes assumptions about the ACE entries in the ACL (system, Administrators, and the user), and that the user is the owner (they typically are). It isn't bullet-proof security, but it can help minimize the casual "save a 2 GB iso file to the roaming profile desktop folder" scenario.
In broad strokes, when a user logs on, at the end of the last logon script, ACL their Desktop and other locations so that they have Read and Execute permission.
In the logOFF script, revert the permissions back to normal.
At the start of the logON script, there should also be a check to reset the permissions to normal in the event that the logoff script failed.
There are a variety of ACL tools to use: icacls, fileacl, setacl.
Determining the correct path can be performed using the following PowerShell syntax:
That should be used to ensure that the operation is performed on the redirected location, and not the local location.
To obtain a list of all the Environment Special Folder locations:
That typically returns:
Desktop
Programs
Personal
MyDocuments
Favorites
Startup
Recent
SendTo
StartMenu
MyMusic
DesktopDirectory
MyComputer
Templates
ApplicationData
LocalApplicationData
InternetCache
Cookies
History
CommonApplicationData
System
ProgramFiles
MyPictures
CommonProgramFiles
Note that there are both Desktop and DesktopDirectory special folders.
Here is a sample PowerShell command to use FileAcl set the Desktop folder to Read and Execute for a user:
To set the folder to Modify permission for the user, arg5 would be:
$arg5 = "
"" + $user + "
"" + ":RWXD"Here a solution without the need to modify the permissions.
This hides the desktop of the options to save as.
This configuration can be deployed using a GPO.
Source:
http://www.sysadmit.com/2018/03/gpo-impedir-guardar-en-el-escritorio.html
For the rest of the folders it would be:
Documents:
Pictures:
Videos:
Downloads:
Music Folder:
Desktop Folder: