Please, could anyone let me know how I can change a folders ownership in Powershell ? I have tried the following :
$FTPPath = "c:\test"
$NewFTPUser = 'TESTFTP'
Get-Acl $FTPPath | Format-List
$ACL = Get-Acl $FTPPath
$Rule = New-Object System.Security.AccessControl.FileSystemAccessRule("TESTFTP","FullControl")
Set-Acl $FTPPath $ACL
The above works for adding permissions to a folder but need to know how to take ownership.