Skip to content

Instantly share code, notes, and snippets.

@danimr
Created March 19, 2015 13:03
Show Gist options
  • Save danimr/447ee7a465ffaed1de1a to your computer and use it in GitHub Desktop.
Save danimr/447ee7a465ffaed1de1a to your computer and use it in GitHub Desktop.
$folder = 'C:\Temp\test.ps1'
$grupo = "grupo"
#quitar herencia
$acl = Get-ACL -Path $folder
$acl.SetAccessRuleProtection($True, $True)
Set-Acl -Path $folder -AclObject $acl
$Ar = New-Object system.security.accesscontrol.filesystemaccessrule($grupo,"FullControl","Allow")
$Acl.SetAccessRule($Ar)
Set-Acl $folder $Acl
$accessrule = New-Object system.security.AccessControl.FileSystemAccessRule("users","Read",,,"Allow")
$acl.RemoveAccessRuleAll($accessrule)
Set-Acl -Path $folder -AclObject $acl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment