This should be simple, but I’m struggling with it today.<\/p>\n
Looking for a very basic Set-Acl powershell command to add BUILTIN\\Users to have ONLY delete access at C:\\Users\\Pulic\\Desktop<\/p>\n
Was trying this based on a google search, but it always fails at the 2nd to last line (AddAccessRule)<\/p>\n
$dir = 'C:\\Users\\Public\\'\n$identity = 'BUILTIN\\User'\n$rights = 'Delete' #Other options: [enum]::GetValues('System.Security.AccessControl.FileSystemRights')\n$inheritance = 'ContainerInherit, ObjectInherit' #Other options: [enum]::GetValues('System.Security.AccessControl.Inheritance')\n$propagation = 'None' #Other options: [enum]::GetValues('System.Security.AccessControl.PropagationFlags')\n$type = 'Allow' #Other options: [enum]::GetValues('System.Securit y.AccessControl.AccessControlType')\n$ACE = New-Object System.Security.AccessControl.FileSystemAccessRule($identity,$rights,$inheritance,$propagation, $type)\n$Acl = Get-Acl -Path \"$dir\\Desktop\"\n$Acl.AddAccessRule($ACE)\nSet-Acl -Path \"$dir\\Assets\" -AclObject $Acl\n<\/code><\/pre>","upvoteCount":4,"answerCount":4,"datePublished":"2021-07-01T17:08:46.000Z","author":{"@type":"Person","name":"spiceuser-ni4z","url":"https://community.spiceworks.com/u/spiceuser-ni4z"},"suggestedAnswer":[{"@type":"Answer","text":"This should be simple, but I’m struggling with it today.<\/p>\n
Looking for a very basic Set-Acl powershell command to add BUILTIN\\Users to have ONLY delete access at C:\\Users\\Pulic\\Desktop<\/p>\n
Was trying this based on a google search, but it always fails at the 2nd to last line (AddAccessRule)<\/p>\n
$dir = 'C:\\Users\\Public\\'\n$identity = 'BUILTIN\\User'\n$rights = 'Delete' #Other options: [enum]::GetValues('System.Security.AccessControl.FileSystemRights')\n$inheritance = 'ContainerInherit, ObjectInherit' #Other options: [enum]::GetValues('System.Security.AccessControl.Inheritance')\n$propagation = 'None' #Other options: [enum]::GetValues('System.Security.AccessControl.PropagationFlags')\n$type = 'Allow' #Other options: [enum]::GetValues('System.Securit y.AccessControl.AccessControlType')\n$ACE = New-Object System.Security.AccessControl.FileSystemAccessRule($identity,$rights,$inheritance,$propagation, $type)\n$Acl = Get-Acl -Path \"$dir\\Desktop\"\n$Acl.AddAccessRule($ACE)\nSet-Acl -Path \"$dir\\Assets\" -AclObject $Acl\n<\/code><\/pre>","upvoteCount":4,"datePublished":"2021-07-01T17:08:46.000Z","url":"https://community.spiceworks.com/t/set-acl-addaccessrule-for-public-folder/804486/1","author":{"@type":"Person","name":"spiceuser-ni4z","url":"https://community.spiceworks.com/u/spiceuser-ni4z"}},{"@type":"Answer","text":"Welcome<\/p>\n
If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>\n