Why does Set-Acl on the drive root try to set ownership of the “object”?

后端 未结 5 1918
一向
一向 2020-12-07 22:45

I would like to change the ACL of the C: drive. What im trying to do is remove the permission that a user can create a folder directly on the drive. I tested th

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 23:31

    $Acl = (Get-Item $Path).GetAccessControl('Access')

    Worked for me. I run my PS Script from CMD and in this PS Script i run another PS Script everything works fine as long as i do it with my own User. When i use different User i get the same Error: Set-Acl : The security identifier is not allowed to be the owner of this object.

    Just changed Get-ACL to that Line above and it worked fine. Thanks again.

提交回复
热议问题