Last active
November 27, 2023 23:00
-
-
Save jszabo98/76c44fd04ee7d9ad831ccf18cd2c1097 to your computer and use it in GitHub Desktop.
Revisions
-
jszabo98 revised this gist
Mar 12, 2018 . 1 changed file with 0 additions and 2 deletions.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 @@ -1,5 +1,3 @@ $acl = Get-Acl -Path C:\SpecialFolder\SpecialFile.txt $user = 'BillB' $rights = [System.Security.AccessControl.FileSystemRights]'ReadAndExecute, Write, Modify, Read' # enum flags -
jszabo98 revised this gist
Mar 12, 2018 . 1 changed file with 2 additions and 0 deletions.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 @@ -1,3 +1,5 @@ .gist pre{font-family:Menlo,Monaco,'Bitstream Vera Sans Mono','Courier New',monospace !important} $acl = Get-Acl -Path C:\SpecialFolder\SpecialFile.txt $user = 'BillB' $rights = [System.Security.AccessControl.FileSystemRights]'ReadAndExecute, Write, Modify, Read' # enum flags -
jszabo98 created this gist
Mar 12, 2018 .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,19 @@ $acl = Get-Acl -Path C:\SpecialFolder\SpecialFile.txt $user = 'BillB' $rights = [System.Security.AccessControl.FileSystemRights]'ReadAndExecute, Write, Modify, Read' # enum flags $rights Modify $RuleBillB = [System.Security.AccessControl.FileSystemAccessRule]::new($user, $rights, 'Allow') $RuleBillB FileSystemRights : Modify, Synchronize AccessControlType : Allow IdentityReference : BillB IsInherited : False InheritanceFlags : None PropagationFlags : None $acl.AddAccesssRule($RuleBillB) Set-Acl -Path C:\SpecialFolder\SpecialFile.txt -AclObject $acl