Skip to content

Permission setup commands

Here are a few useful commands to setup Windows file permissions.

Take Ownership of a folder(including files and subfolders)
Takeown /f foldername /r /d y

Reset Permission of folder(including all files and subfolders) to Inherit
Icacls folder /reset /T

disable inheritance for a
icacls Folder/inheritance:d

Set read permission for AD group on folder and subfolder
Icalcs Folder /grant domain\Groupname:(OI)(CI)RX /T

Set modify permission for AD group on folder and subfolder
Icalcs Folder /grant domain\Groupname:(OI)(CI)M /T

Set listing permission to this folder only
Icacls Folder /grant domain\group:(X,RD)

Remove Permission from Folder and subfolder
Icacls folder /remove domain\group