- Before taking ownership of files and folders I would like to understand how to view the current permissions so that they may be reverted.
- I am reciving an 'Access Denied' message to view or save permissions with elevated command prompt for location: C:\ProgramData\Microsoft\Windows\SystemData in Windows 10 enviroment.
- It looks like that I may need to take ownership first, then can view the permissions, and use something like icacls 'reset' command to fix it afterwards.
If I try to view permissions:
C:\Windows\system32>icacls "C:\ProgramData\Microsoft\Windows\SystemData"C:\ProgramData\Microsoft\Windows\SystemData: Access is denied.Successfully processed 0 files; Failed processing 1 files
If I try to save an ACL file:
C:\Windows\system32>icacls C:\ProgramData\Microsoft\Windows\SystemData /save "C:\SystemData.acl" /tC:\ProgramData\Microsoft\Windows\SystemData: Access is denied.Successfully processed 0 files; Failed processing 1 files
In the answer to 'Understanding how to use Icals & Takeown' the owner of the folder was NT SERVICE\TrustedInstaller which may infact may be a standard in Windows 10, though I am only guessing.
Should I just use takeown, and icals, find out the permissions and then use the reset command.
takeown /f C:\ProgramData\Microsoft\Windows\SystemData /ricacls C:\ProgramData\Microsoft\Windows\SystemData /grant "%USERDOMAIN%\%USERNAME%":(F) /tMake Changesicacls C:\ProgramData\Microsoft\Windows\SystemData /setowner "NT SERVICE\TrustedInstaller" /ticacls C:\ProgramData\Microsoft\Windows\SystemData /reset /t
Likewise with the ACL, one would need to take ownership before creating, or is there a work around?
Reading:
- SU - Understanding how to use Icals & Takeown to make changes and reset in Windows 10
- SU - Create List of Access Denied Files & Folders
- SU - Setting Deny Permissions with ICACLS on “This Folder”
- SU - Is there a way in which I can use takeown to apply ownership to every directory on the drive?
- SU - Takeown grant permission
- SU Can I revert changes from the TAKEOWN and ICACLS commands?
- Howtogeek - Reverse take ownership
- Faqforge - Take Ownership of a File or Folder by Command in Windows
- Microsoft - ICACLS setowner and GRANT operation appears to be causing some existing perms on subfolders to be removed. Why
- Itprotoday - Removing a User or Group’s Permissions
- SS46 - Takeown
- SS64 - Icacls