Powershell Set-Acl fails
Posted
by Ulrich
on Server Fault
See other posts from Server Fault
or by Ulrich
Published on 2010-03-24T22:20:39Z
Indexed on
2010/03/24
22:23 UTC
Read the original article
Hit count: 233
powershell
|acl
While working on a little backup script I try to change the ACL of a file using Set-Acl in Powershell 1 on Vista and always get the following error message:
Set-Acl : The security identifier is not allowed to be the owner of this object.
This error persists even if I go a minimal script:
$acl = Get-Acl $sourcepath$file
$acl |format-list
Set-Acl -path $sourcepath$file -AclObject $acl
Does anyone know the reason for this error? Obviously I'm not changing the ownership of the file...
BTW: What I ultimately want to achieve is to reduce all access rights to ReadAndExecute. Is there maybe an easier way of doing this in Powershell?
Thanks for your help! Ulrich
© Server Fault or respective owner