about the puzzle 8 solution

This topic contains 0 replies, has 1 voice, and was last updated by  js 2 months, 2 weeks ago.

  • Author
  • #95649


    You can set multiple enum flags like this: (I got it from http://www.latkin.org/blog/2012/07/08/using-enums-in-powershell/) (Although it comes out as 'Modify, Synchronize')

    $acl = Get-Acl -Path C:\SpecialFolder\SpecialFile.txt
    $user = 'BillB' 
    $rights = [System.Security.AccessControl.FileSystemRights]'ReadAndExecute, Write, Modify, Read'  # enum flags
    $RuleBillB = [System.Security.AccessControl.FileSystemAccessRule]::new($user, $rights, 'Allow') 
    FileSystemRights  : Modify, Synchronize
    AccessControlType : Allow
    IdentityReference : BillB
    IsInherited       : False
    InheritanceFlags  : None
    PropagationFlags  : None
    Set-Acl -Path C:\SpecialFolder\SpecialFile.txt -AclObject $acl

    Btw, amazing that any user can still write to places like C:\ and C:\ProgramData.

You must be logged in to reply to this topic.