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

后端 未结 5 1909
一向
一向 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:26

    You need the SeRestorePrivilege to set the owner. I used Lee Holmes' script from the URL below to elevate my process with this additional priv and was able to set the owner to someone other than myself.

    http://www.leeholmes.com/blog/2010/09/24/adjusting-token-privileges-in-powershell/

    I tried the (get-item $path).getaccesscontrol("access") method but still got the same error since my process didn't have the SeRestorePrivilege.

提交回复
热议问题