Forbid removal of Windows folders

svenny

Dabbler
Joined
Nov 10, 2018
Messages
10
I'm using TrueNAS Core ( version 13.0-U5.3 ) connected to a Windows AD server. The system is working very well. My issue is that I can't prevent deletion of Windows user profile folders: when a new profile is created Windows creates some folder for the new user (for example "Documents" or "Downloads" etc.): I would like to forbid removal of these folders.

I tried to follow the advice given in this thread:

How to set the user not allow to delete a file or folder in FreeNAS

but without success.

I've also tried with chattr command but this is not supported:

Code:
chattr +i Desktop
chattr: Operation not supported while setting flags on Desktop


Is there a way to resolve this issue?

Many thanks in advance.

Cheers.
 

svenny

Dabbler
Joined
Nov 10, 2018
Messages
10
I also tried with chflags command:

Code:
chflags uchg Desktop
chflags: Desktop: Operation not supported


Same result as with chattr.

Cheers.
 

svenny

Dabbler
Joined
Nov 10, 2018
Messages
10
It seems that ZFS on FreeBSD only supports the use of schg as indicated by the following thread:

Unable to chflags on ZFS filesystem

So I tried the following command:

Code:
 chflags uchg Desktop


The uchg flag has been set correcty:

Code:
ls -lo Desktop
drwxrwxrwx+ 3 DOMAIN\user  DOMAIN\domain admins  schg,uarch   5 Dec 11 16:45 Desktop


But the Desktop folder is still removable by the Windows user...

Cheers.
 
Top