Skip to content

Instantly share code, notes, and snippets.



Created Jan 17, 2021
What would you like to do?
Take ownership and assign permissions in Windows
takeown /f "c:\files" /r
:: get permissions from a sample file
$NewAcl = Get-Acl File0.txt
:: apply those permissions to other files
Get-ChildItem -Path "C:\files" -Recurse -Include "*.txt" -Force | Set-Acl -AclObject $NewAcl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment