Quote Originally Posted by Arthur View Post
Did you run it from an elevated PowerShell prompt? The part of the script that sets the owner in post #4 worked for me when I tried it. i.e.

$path = "$env:SystemDrive\Example"
$acl = Get-Acl $path

$acl.SetOwner([System.Security.Principal.NTAccount] "Administrators")
Set-Acl $path $acl
Yup, I tried elevated and normal, both just gave Access Denied.

It was something to do with Powershell, Windows permissions and using local drives/paths that I didn't really understand but trying to change it to the user who's home directory it was always gave Access Denied.