Created
March 19, 2015 13:03
-
-
Save danimr/447ee7a465ffaed1de1a to your computer and use it in GitHub Desktop.
Revisions
-
danimr created this gist
Mar 19, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ $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