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.