We wanted to collect usage statistics for all shares on different file servers.
It tries to find out how much disk space is consumed under each share as well as the amount of files under each.
The problem is that it has blocked the inheritance of certain permissions on the NTFS side, so the account used in the SCOM account (Run-as) cannot properly monitor what it wants. It uses custom scripts to monitor the disk space used and the number of files,
but it receives an error message regarding access rights (due to inheritance blocked on the NTFS).
The Run-as account is not a local administrator account on the file server side. We did Script testing with the System account and with an AD account that was a member of the Local Administrators group and we got AccesDenied.
Manually adding the permissions on a folder works.
Planning to use icacls, but we have many folders were inheritance is disabled.
https://technet.microsoft.com/en-us/library/2009.07.geekofalltrades.aspx
https://stackoverflow.com/questions/2928738/how-to-grant-permission-to-users-for-a-directory-using-command-line-in-windows
Any help or suggestions appreciated.