How to change or add permission of a file or folder using sccm

MPEG 336 Reputation points
2021-08-23T14:37:49.72+00:00

Hi,

I want to add "everyone" permission to a file or folder and give him full access using sccm.
Is there any way to that? I have 140 Clients.

Regards

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,651 questions
0 comments No comments
{count} votes

Accepted answer
  1. Amandayou-MSFT 11,141 Reputation points
    2021-08-24T07:13:13.087+00:00

    Hi @MPEG ,

    Agree with Jason, the PowerShell “set-acl” cmdlet is used to change the security descriptor of a specified item, such as a file, folder or a registry key; in other words, it is used to modify file or folder permissions. The following script sets the “FullControl” permission to “Allow” for the user “ENTERPRISE\T.Simpson” to the folder “Sales”:

    $acl = Get-Acl \fs1\shared\sales

    $AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("ENTERPRISE\T.Simpson","FullControl","Allow")

    $acl.SetAccessRule($AccessRule)

    $acl | Set-Acl \fs1\shared\sales

    We could modify the example and deploy it as package to the client, and about the detail of how to manage file system ACLs with PowerShell Scripts, please refer to this article:
    https://blog.netwrix.com/2018/04/18/how-to-manage-file-system-acls-with-powershell-scripts/
    Note: Non-Microsoft link, just for the reference.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Jason Sandys 31,306 Reputation points Microsoft Employee
    2021-08-23T16:32:01.297+00:00

    There's nothing built- into ConfigMgr to control file or folder permissions on managed devices. However, you can easily create a PowerShell script to do this and push this out using ConfigMgr. Alternatively, you can create a package and program in ConfigMgr that runs cacls or icacls that configures permissions on files and folders.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.