I need to add (not replace) in the ACLs folders and subfolders some Admin users and groups.
The folders already have some users and groups (with full access) which doesn't allow at the powershell script the access to the folders and add additional new users because the access is denied.
I tried to force the addition of the local administrator user but the command below didn't work :
icacls D:\test\Vol2 /grant "Administrator":F /T
I tried then taking the ownership of each folder (by the local admin) with the command below:
takeown /f D:\test\Vol2" /r /d y
which it seems worked (I did a test on a copied folder).
However I have noticed the administrator become also a member of the ACL but on some folders it has been replaced to all users present (not added).
How can I ensure that the administrator user can take the ownership of each folder without replacing the others users (already present in the ACLs)?
Thanks