![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Problem with SetOwner in windows PowerShell Hi, I'm looking for a solution. I'm trying to change the owner of a directory. I've no permission and I'm not the owner of the directory. I get the following error: "Get-Acl: Attempted to perform an unauthorized operation". Here is my PowerShell-script: $AclFolder = Get-Acl -path $Folder // Error: Get-Act: Attempted to perform an unauthorized operation. $Users = New-Object System.Security.Principal.NTAccount($DomainAdmins) $AclFolder.SetOwner($Users) Set-Acl -path $Folder -aclObject $AclFolder I'm running the PowerShell-script as a Domain Administrator. If I use the Windows-GUI, I can change the owner without a problem (incl. subcontainers and objects). Do you know a solution for my problem? Thank you, Adrian EggHeadCafe - .NET Developer Portal of Choice http://www.eggheadcafe.com |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: Problem with SetOwner in windows PowerShell Are you logged in to windows with a user that has sufficient privileges (admin rights) prior to launching PowerShell? ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||
| Guest | Re: Problem with SetOwner in windows PowerShell Adrian wrote:
Like Shay mentions though, if Vista, how are you starting PowerShell? Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
My System Specs![]() | |||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Problem with SetOwner in windows PowerShell Oisin,did make a set-owner Cmdlet for this, also you can use the PowerShell COmmunity extensions privileges cmdlets to fix this. Greetings /\/\o\/\/ "Marco Shaw [MVP]" wrote:
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| when run powershell script as windows service ,powershell fail | powershell fail on winodws 2008 | PowerShell | 6 | 01-15-2008 03:20 PM |
| Powershell problem in querying some remote Windows 2003 servers | James | PowerShell | 1 | 08-22-2007 12:53 PM |
| Powershell problem in querying some remote Windows 2003 servers | James | PowerShell | 1 | 08-22-2007 09:10 AM |
| SetOwner on an acl not working | Angelina | PowerShell | 4 | 08-13-2007 04:24 PM |
| PowerShell RC2 RTF File Problem | =?Utf-8?B?Um9iZXJ0IEJlcm5zdGVpbg==?= | PowerShell | 2 | 09-28-2006 02:20 PM |