![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | a set-acl (change owner) problem Hi guys. I'm trying to set-up a virtual web folder and to do it I firstly create it then (trying to) set owner to the user i create it for and finally mark it a virtual web directory. Here how it goes: write-host -n "nazwa konta:" $username = Read-Host if( $username.trim() -eq "") { break; } ### tworzymy strone $homedir = (ls env:homedrive).value + "\Documents and Settings\" + $username + "\My Documents\" $wwwdir = $homedir + "public_www" mkdir $wwwdir $account = new-object system.security.principal.ntaccount("CHESLAV\" + $username) $acl = get-acl -path "$wwwdir" $acl.setowner($account) set-acl -path "$wwwdir" -aclObject $acl #### here i get the error cacls "$wwwdir" /E /G IUSR_CHESLAV:R > $null iisvdir /create "Uzytkownicy" "$username" "$wwwdir" Unfortunately, get the error saying: Set-Acl : The security identifier is not allowed to be the owner of this object. At line:1 char:8 + set-acl <<<< -path "$wwwdir" -aclObject $acl and if I try to use xxx instead i receive the following: PS C:\root> $dirobj.setaccesscontrol($acl) Exception calling "SetAccessControl" with "1" argument(s): "The security identifier is not allowed to be the owner of t his object." At line:1 char:25 + $dirobj.setaccesscontrol( <<<< $acl) (where $dirobj is retrived using get-item $wwwdir in this case) What's worth a notice, when $account is acquired frome "Administrator", all goes well. Any help? |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| How to change a file's owner? | Vista file management | |||
| How do I change the owner in C:/user/owner | General Discussion | |||
| Change all references held by previous owner/administrator to new owner | System Security | |||
| Change administrator owner | Vista account administration | |||
| Change Registered Owner Name | Vista General | |||