I have a batch file that I run to set file and folder permissions, usually when a user leaves and new user takes their place and so have to change user based permissions of work files. It work as I want except for the files in the lowest level directory.
Icacls C:\Data\Users\UserName /inheritance:r /grant:r "Domain Admins":(OI)(CI)F /grant:r "Rob":(OI)(CI)F /grant:r "mmm":(OI)(CI)F /T /C
Icacls C:\Data\Users\Rob /inheritance:r makes sure permissions for C:\Data\Users does not apply to the UserName Directory--and I think this may be the cause of my problem but not sure how to fix it.
All files and folders get the permissions I want them to have but files in Icacls C:\Data\Users\UserName\My Documents\FolderName have no permissions set but files in C:\Data\Users\UserName\My Documents\ have the proper permissions. So it seems that files in the lowest level folder has all its permissions removed.
If someone knows of a better way to do this with say powershell I am all for a solution like that too. Thanks.