none
Issues in Set-ACL Powershell RRS feed

  • Question

  • I am having trouble while setting ACL permission on my domain servers, Using windows 2012r2 with powershell 5.0.

    I am running below code but screen is just stuck no output or result. Permission is also not set on server.

    $acl = Get-Acl "\\$server\$Share"
    
    $rule = New-Object System.Security.AccessControl.FileSystemAccessRule("hosting\ctx-users","Modify", "ContainerInherit, ObjectInherit", "None", "Allow")
    $acl.AddAccessRule($rule)
    
    $rule = New-Object System.Security.AccessControl.FileSystemAccessRule("Users","Modify", "ContainerInherit, ObjectInherit", "None", "Allow")
    $acl.AddAccessRule($rule)
    
    $acl |Set-Acl "\\$server\$Share" 

    Please can you help.Target share is D: drive by using NET SHARE.

    Monday, June 29, 2020 2:32 PM

Answers

All replies