Ownership and Permissions situation

I just upgraded to a new PowerMac G5 machine after being plagued by problems with my ealier G5. I have been unable to use Backup to restore my files, and I have a copy of my users folder on another hard drive.
The problem is that most of the folders inside my users folder say that I have insufficient permissions to access the data. Is there another way I can get to this data, or a way in which I can log into my computer to let it know I am the owner of these files?
Matt

Hi
Welcome to Apple Discussions!!
I have a copy of my users folder on another hard drive.You can set the system to ignore permissions on this drive, at least while you copy your files. This would be quicker than using your admin account to change ownership on all the files.
Select the volume (hard disk) and then choose "Get Info" from Finder's File menu, or use the Command-I shortcut. At the bottom of the Info pane you will see a checkbox labelled "Ignore ownership on this volume". Check that and you will be able to access anything on the disk. You may need to log out and back in, although I don't think this should be necessary.

Similar Messages

  • DANGER: Do Not Change Hard Drive Ownership and Permissions

    DANGER: Do Not Change Hard Drive Ownership and Permissions (Unless you know what you are doing... I didn't!)
    FIRST, THE REPAIR PERMISSIONS SOLUTION:
    Use Disk Utilities on the "Sofware Install and Restore" DVD that came with your computer to set the permissions back to the defaults. Not the MacOSX Installation Disk. (This worked in MacOS 10.3.9)
    MY SCREW UP
    In my Hard Drive's "Get Info" dialog I switched the permissions of the Owner to my username and all others to no access. I had not yet closed the dialog and decided that it was probably dangerous so I started changing them back. I first changed the owner back to system. It asked for authentication.
    After entering my password I assumed that I would be able to go back and change the others as well. Nope! The dialog disappeared, my desktop disappeared and I couldn't do anything. I was locked out.
    After ten minutes of the beachball I restarted to the "Panther Installation disk" and tried repairing permissioins using disk utility. Evertime it "lost contact" with the system and would not work. Restarting (without CD) took me to a root user login (black sreen). My username and password did nothing.
    THE SOLUTION
    I then restarted to the "Software Install and Restore" DVD that came with my computer and used its Disk Utility to repair permissions. IT WORKED! It set permissions back to the default. THANK GOD.
    NOTE: I wonder, will using the Install and Restore DVD to repair permissions reset any computer's files to the defaults? Is that a backdoor into someones currently restricted files and folders? (Assuming that you have physical access and the computer specific DVD)

    Using the Repair Permissions function will not change the permissions on an account's home folder or anything in it, but there are at least two other ways in which someone with a Mac OS X 10.4 installation disk can get access to an account's files or folders unless some or all of those files are encrypted.
    (19285)

  • Automate ownerships and permissions

    Every time I create a new file or folder I have to - get info and change the ownership and permissions in Access and others from Read only to read and write, to allow access for others.
    Is there a way to automate this in 10.4 and 10.5?
    Cheers,
    Steve

    1. This is specified during installation.
    2. The owerships are setup per the selections provided during installation.
    3. Usually the owner is oracle with group dba
    4. You only have to run changePerm.sh if you want to open up access on your filesystem for users to access sqlplus, exp, tkprof, etc from $ORACLE_HOME/bin. If you only run applications from client machines or external applications servers, it is more secure to leave the default filesystem permissions on the Oracle Homes.

  • Ownership and permissions of Mac users don´t match windows

    Hi
    I have ownership and permissions problem on Windows. Hopefully anyone can help.
    I created a user and gave the user permissions
    1- NOT ALLOW TO SAVE FILES ON THE DESKTOP -->READ ONLY
    The ownership and permissions only work on Mac OS machine. and DON´T WORK ON Microsoft Windows machines.
    Anyone can tell me what I have to do and stop the problem.
    Thank you
    Regards
    Tri

    The Desktop folders on Mac and Windows machines are in different locations, so you will need to change permissions in both locations for this to work.
    For Mac, the Desktop is ~/Desktop, for Windows it is located in the User Profile, under the Desktop folder.
    --Tim

  • Messed up ownership and permissions, now I'm stuck in Terminal

    I tried to make a couple of volumes inaccessible to others (via Ownership and Permissions in the Get Info pane for each drive) and I guess I did it to my boot drive too. Now when I boot I get the Terminal, and I'm clueless there. How do I undo what I've done so that I can use this box?
    In the long run I'd like to require a password to view the contents of my drives (help with that is welcome) but in the short term full access would be fine.
    Terminal asks me to login, which I do, and then says "Welcome to Darwin!"
    What do I do next?

    cornelius
    Are there any guidelines for working with Ownership and Permissions in Get Info?Well, there are several KB documents on permissions, but not a lot of guidance. The most relevant are, perhaps, Mac OS X 10.2: How to Change Ownership & Permissions Using the Finder and Mac OS X: Troubleshooting Permissions Issues.
    In the latter, there is some guidance:
    Warning: This document describes how you may modify permission settings by entering commands in the Terminal application. Users unfamiliar with Terminal and UNIX-style environments should proceed with caution. The entry of incorrect commands may result in data loss and/or unusable system software. Improper alteration of permissions can result in reduced system security and/or exposure of private data.Basically my advice would be to leave everything outside your Home folder alone unless you really know what you are doing. If you have accidentally changed something outside the Users folder, run Repair Permissions to get it back as it should be.
    Edit: and read Niel's advice (I went to bed just after reading your post since it was twenty past one here, and didn't "Refresh" before replying, so didn't see Niel had posted).

  • Lost ownership and permissions on an external hard drive

    Hey,
    I have a LaCie 500GB external HD that i connect to my MacBook via firewire.
    I was checking the amount of space left of the external HD by clicking command-I on it. I accidentally changed the ownership & permissions and now my account has no access to it. I can't see the HD on my desktop but when I go into Disk Utility, i can see that it's there but I can't repair its permissions.
    to see whether I could still have access to it, I created another user account and gave it admin status and am able to access the HD there.
    Is there any way to restore the ownership and persmissions of my external HD on my primary account?
    i feel stupid
    many thanks

    I was excited by a resolution to the same problem I have (I don't know what Ownership & Permissions I should have on my external -- bootable -- HD). Mistakenly I used Leopard to set them up rather than Mac OSX 10.4.11. Now I no longer had access to the HD nor would it show up on the desktop on Mac OSX 10.4.11 although the Disk Utitlity showed that it existed. I finally erased and cloned the disk but don't know what Permissions I should set it at. "Niel" supposedly answered this problem but his answer was "click here and follow the instructions" which does not show up on the forum. I can't find any other discussion of my specific problem nor an explanation of various permissions sets for Hard Disks internal nor external. If someone could help me I would be grateful. I am in Japan far from any Apple Stores or shops. Thank you.

  • Unable to download from AppStore, updates,etc.Messages 'the installer is damaged' to 'there might be a problem with file ownership and permissions.' I am the owner and only user of a new MBP. What could be going on?

    Is anyone having the same type of problems I'm having with Lion. I have a new MacBook Pro, received 7 weeks ago, preinstalled with Leopard 10.6.7. I didn't migrate anything from my old iMac, wanted a clean install from the Apple Store. While there, I asked for the upgrade to Lion 10.7, however their system was down.
    I  installed it myself, wirelessly about a week later, and Apple emailed me a receipt. Now, I've had to call support directly last week when I lost Mail, Address Book, was unable to open Preview or iTunes, among other problems. Seemed fixed after a session that baffled even the store tech.  Now I am unable to download or install the recent Mac updates for Lion, from the App Store, could not install Adobe Reader, etc. Messages range from 'A network error has occured - Check your Internet connection and try again' to 'The Installer is damaged and cannot open the package. There may be a problem with file ownership or permissions.'  All fail and I'll probably have to call Apple again. I am frustrated beyond words.  Logs 'Install's runner tool is not properly configured as a setuid tool', domain errors, 'attempt to write a readonly database, and on and on. I have barely done a thing on this computer except search online for help with these problems. Safari gives me a 'You are not connected to the internet' too often. Diagnostics disagrees. I do see wi-fi problems in the forum. Disk and permissions were fine at the beginning of the earlier problems, checked first by support tech. I'm not sure if support tech even knew. I was just happy they were fixed. Anyone have these download and/or install problems after a 'clean bill of health' so to speak, only a week ago?

    Let's try the following user tip with that one:
    "There is a problem with this Windows Installer package ..." error messages when installing iTunes for Windows

  • Default Group Ownership and Permissions

    All new files created by a standard user (User1) have group assigned as "staff" and group permissions set to "Read only."  How do I change the default group and ownership permissions for newly created files?
    Said another way: I want new files created by User1 to have group = "Accounting Group" and group permisions = "Read & Write".

    You can accomplish what you want to do by using ACLs. First go to System Preferences -> Users & Groups, and make a new group called "accountinggroup". Add the users you want to the group.
    You will then need to make a folder in which to store all the files to be shared with this group. Put it in some easily accessible place like in /Users/Shared.
    Then log in to an admin account and open Terminal. Paste in all of this and the press return:
    sudo chmod -R +a "accountinggroup allow delete,chown,list,search,add_file,\
    add_subdirectory,delete_child,file_inherit,directory_inherit" \
    Then drag the folder into the Terminal window and press return again.
    From then on, any file that is newly created in or copied to any location within that folder hierarchy will have read and write privileges for all users in accountinggroup.
    You sir are a genius.
    I have been trying to utilise a users iMac a "central file storage" for a small business client (all new Lion Machines). I was having so many issues with Lion's POSIXs permissions and also Lion's new versions feature.
    Every time users saves files to the shared folder they would inherit permission from the computer that created the file. Thus is another user logged on and opened the file it would be 'Locked' and have to be duplicated or the users would have to manually edit permission using 'Get Info'
    I have applied the ACL via terminal and now it works like a dream! All files have that are put into the shared folder have a group with 'custom' permissions and any one can use and modify the files, provided they have log in credentials.
    The only trap i would warn people of is do not use typical group names like "Staff", "workgroup" etc. I found that using those was problematic. I opted for employees.
    Thanks again Király

  • Ownership and permissions problem

    Hi all
    I've got a new iMac 27" running 10.6.4. Following my old Mac Pro's departure I have copied all my backed up work files and folders from an external drive to my documents folder (not via Migration Assistant / Time Machine backup - MA wouldn't recognise the drive!). I can open the files without problem, but I can't save them to the same file or folder. If I try to do so, I get a message saying the file is either read-only, I don't have permission, it may be open by another application, close everything - basically I can't. If I create a new folder with its own new files, I can save and re-save without a problem, its just my old/existing work files that I can't work on.
    I've just spent an hour and a half on the phone to Applecare who cannot resolve this. We tried fixing permissions from the Mac OSX startup disc, creating a new user account with admin capabilities, manually getting info on specific files and checking the permissions, unlocking and applying permissions to all enclosed files and folders so they have read and write capability, but nothing works. Applecare tell me to re-save the files with a new name in a new location. I have literally hundreds of thousands of files, this is not an attractive solution. So they suggested I try and find a 3rd party app that will batch-change ownership on these files.
    I've read a lot about people with permissions problems but none quite the same as mine. If the Apple OS (get info) and Disk Utility cannot change the permissions so I can work effectively, can another piece of software realistically do this?
    Any help would be much appreciated.
    Dave

    Thanks for the reply baltwo. I did that, and this is what I got:
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00001.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00002.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00003.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00004.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00005.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00006.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00007.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00008.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00009.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00010.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00011.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00012.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00013.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00016.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00017.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00018.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/mar07_copyoff/pics_nmovies/DSC00019.JPG: Operation not permitted
    chown: /Users/davegray/Documents/GGbackup/2007-copyoff/nov07copyoff/london mums/LaunchU3.exe: Operation not permitted
    I tried to open, amend and save a file (not related to any of the above document paths) and am still getting:
    "The file may be read-only, or another user may have it open. Please save the document with a different name or different folder."

  • Ownership and permissions

    got a mac finally. i am the owner and only user of this machine. i want to set up permissions for it. how do i do this? do i do this for just the hard drive or do i need to do this for each software, folder and file that is installed? i am trying to install the time update software for palm but it wont allow cause it says that i dont have permission. tks for any help

    finder cannot complete operation because some data in osx could not be read or written error code 36OK, that is nothing to do with permissions.
    Unfortunately, error -36 is an "unspecified" I/O Error:
    <pre>ioErr = -36, /*I/O error (bummers)*/</pre>and, of course, it doesn't tell you whether the error is in reading the update or trying to write to your HD.
    I would download the update again (hoping that is the problem). But you should also start from your Install DVD and run Disk Utility to Repair Disk, as explained in this KB article: Using Disk Utility and fsck to resolve startup issues or perform disk maintenance. Let us know if this makes it go away.

  • Directory ownership and permissions

    After installing WebLogic Server (in /opt/bea as root), I tried to start the admin server and the workSpaceStudio, but both complained about file/directory permissions on various locations under the /opt/bea directory. I started fixing this by opening up group write access to the user_projects directory, but I ended up chasing down countless other permission problems in other places. I eventually gave up trying to find all of the individual directories that needed group write access enabled and managing group ID's from the user accounts.
    I don't want to open up write access on the whole /opt/bea/... directory tree to everyone, but I do need to support multiple users from the same installation.
    What is the best way to do this?
    Thanks,
    Eric

    Eric,
    Are you trying to install BEA using root/root and then trying to start Weblogic server instances in a domain using other user/group? If this is the case there might be some permissions problems as most of the Weblogic libraries will be owned by root.
    - - Weblogic Consultant

  • MY Hard Drive says_"YOU CAN READ ONLY" for the OWNERSHIP AND PERMISSSIONS!

    I cannot add anything to my EXTERNAL (SimpleDrivePS) hard drive. When I try to copy something to it, it says "The item cannot be moved because SimpleDrivePS cannot be modified."
    Upon control-clicking this external hard drive's icon, under "Get info" it says "You can read only" for it's "Ownership and Permissions."
    I have used this hard drive with Windows-based computers, but not with this new Apple yet.
    What do I need to do so that I can move or copy things to this external hard drive?
    Also, is there a discussion room for just general questions? - There are many little things that I wonder how to do from time to time as I am trying to become accustomed with Apple, like shortcut key for desktop, or where is control panel or link to "my computer" or other shortcut keys - things like that.

    Hi newsppler;
    Since I have never had a disk that was formatted NTFS, I am not absolutely sure exactly how you can discover how it is formatted. I think if you look at the disk with Disk Utility that should tell you.
    Yes. If you reformat you will lose everything that is currently on that disk.
    To reformat open Disk Utility and then select the disk. You then click the partition tab. This will allow you to select what format you wish to use. I would suggest Mac OS Extended +
    Allan

  • Firewire and permissions

    I bought a firewire drive to back up all users' data.
    I made just one partition and unchecked "Ignore ownership".
    However, any user can bring up the firewire drive and look at any files. Even those she shouldn't have permission for.
    I notice that if any user does a "cd" to that Volume, an "ls -l" shows all files belonging to the logged-in user.
    This isn't right. We need to keep private files private.
    How can I make it really enforce ownership and permissions?
    Thanks.
    Example:
    As user jimmy:
    admin1:/Volumes/Backup jimmy$ ls -al
    drwxr-xr-x 5 jimmy unknown 170 7 Jan 18:52 .
    As user sharon:
    sharon:/Volumes/Backup sharon$ ls -al
    drwxr-xr-x 5 sharon unknown 170 7 Jan 18:52 .
    various   Mac OS X (10.3.9)  

    Hi Jm,
    Use the following command to check whether the disk has permissions enabled.
    vsdbutil -c /Volumes/Backup
    You should see-
    Permissions on '/Volumes/Backup' are enabled.
    If permissions are not enabled then issue this command.
    vsdbutil -a /Volumes/Backup
    Change the owner of /Volumes/Backup to root and the group to admin with this command.
    sudo chown 0:80 /Volumes/Backup
    Then grant admin users the ability to write to the drive with this command.
    sudo chmod 775 /Volumes/Backup
    Folders and files within the drive may need their permissions tweeked. If any files show as associated with the group unknown then you need to change the owner and group of that file. Files owned by the magic unknown user show as being owned by the current login user.

  • Webserver - correct owner and permissions

    Hi
    Seem to have got hacked by a "Turkish Hacker". Must have changed my ownership and permissions on the folder containing the website.
    What is correct ownership and permissions I should apply to the folder? Am using BareBones SuperGetInfo to process this.

    And by permissions, I mean Read / Write / Execute for each of Owner / Group / World (rather than 775 or whatever)

  • Solved - How to take ownership and change permissions for blocked files and folders in Powershell

    Hello,
    I was trying to take ownership & fix permissions on Home Folder/My Documents structures, I ran into the common problem in PowerShell where Set-Acl & Get-Acl return access denied errors. The error occurs because the Administrators have been removed from
    file permissions and do not have ownership of the files,folders/directories. (Assuming all other permissions like SeTakeOwnershipPrivilege have been enabled.
    I was not able to find any information about someone successfully using native PS to resolve the issue.  As I was able to solve the issues surrounding Get-Acl & Set-Acl, I wanted to share the result for those still looking for an answer.
    Question: How do you use only Powershell take ownership and reset permissions for files or folders you do not have permissions or ownership of?
    Problem: 
    Using the default function calls to the object fail for a folder that the administrative account does not have permissions or file ownership. You get the following error for Get-Acl:
    PS C:\> Get-Acl -path F:\testpath\locked
    Get-Acl : Attempted to perform an unauthorized operation.
    + get-acl <<<< -path F:\testpath\locked
    + CategoryInfo : NotSpecified: (:) [Get-Acl], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetAclCommand
    If you create a new ACL and attempt to apply it using Set-Acl, you get:
    PS C:\> Set-Acl -path F:\testpath\locked -AclObject $DirAcl
    Set-Acl : Attempted to perform an unauthorized operation.
    At line:1 char:8
    + Set-Acl <<<< -path "F:\testpath\locked" -AclObject $DirAcl
    + CategoryInfo : PermissionDenied: (F:\testpath\locked:String) [Set-Acl], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.SetAclCommand
    Use of other functions like .GetAccessControl will result in a similar error: "Attempted to perform an unauthorized operation."
    How do you replace owner on all subcontainers and objects in Powershell with resorting to external applications like takeown, icacls, Windows Explorer GUI, etc.?
    Tony

    Hello,
    Last, here is the script I used to reset permissions on the "My Documents" tree structure that admins did not have access to:
    Example:  Powershell script to parse a directory of User-owned "My Document" redirection folders and reset permissions.
    #Script to Reset MyDocuments Folder permissions
    $domainName = ([ADSI]'').name
    Import-Module "PSCX" -ErrorAction Stop
    Set-Privilege (new-object Pscx.Interop.TokenPrivilege "SeRestorePrivilege", $true) #Necessary to set Owner Permissions
    Set-Privilege (new-object Pscx.Interop.TokenPrivilege "SeBackupPrivilege", $true) #Necessary to bypass Traverse Checking
    #Set-Privilege (new-object Pscx.Interop.TokenPrivilege "SeSecurityPrivilege", $true) #Optional if you want to manage auditing (SACL) on the objects
    Set-Privilege (new-object Pscx.Interop.TokenPrivilege "SeTakeOwnershipPrivilege", $true) #Necessary to override FilePermissions & take Ownership
    $Directorypath = "F:\Userpath" #locked user folders exist under here
    $LockedDirs = Get-ChildItem $Directorypath -force #get all of the locked directories.
    Foreach ($Locked in $LockedDirs) {
    Write-Host "Resetting Permissions for "$Locked.Fullname
    #######Take Ownership of the root directory
    $blankdirAcl = New-Object System.Security.AccessControl.DirectorySecurity
    $blankdirAcl.SetOwner([System.Security.Principal.NTAccount]'BUILTIN\Administrators')
    $Locked.SetAccessControl($blankdirAcl)
    ###################### Setup & apply correct folder permissions to the root user folder
    #Using recommendation from Ned Pyle's Ask Directory Services blog:
    #Automatic creation of user folders for home, roaming profile and redirected folders.
    $inherit = [system.security.accesscontrol.InheritanceFlags]"ContainerInherit, ObjectInherit"
    $propagation = [system.security.accesscontrol.PropagationFlags]"None"
    $fullrights = [System.Security.AccessControl.FileSystemRights]"FullControl"
    $allowrights = [System.Security.AccessControl.AccessControlType]"Allow"
    $DirACL = New-Object System.Security.AccessControl.DirectorySecurity
    #Administrators: Full Control
    $DirACL.AddAccessRule((new-object System.Security.AccessControl.FileSystemAccessRule("BUILTIN\Administrators",$fullrights, $inherit, $propagation, "Allow")))
    #System: Full Control
    $DirACL.AddAccessRule((new-object System.Security.AccessControl.FileSystemAccessRule("NT AUTHORITY\SYSTEM",$fullrights, $inherit, $propagation, "Allow")))
    #Creator Owner: Full Control
    $DirACL.AddAccessRule((new-object System.Security.AccessControl.FileSystemAccessRule("CREATOR OWNER",$fullrights, $inherit, $propagation, "Allow")))
    #Useraccount: Full Control (ideally I would error check the existance of the user account in AD)
    #$DirACL.AddAccessRule((new-object System.Security.AccessControl.FileSystemAccessRule("$domainName\$Locked.name",$fullrights, $inherit, $propagation, "Allow")))
    $DirACL.AddAccessRule((new-object System.Security.AccessControl.FileSystemAccessRule("$domainName\$Locked",$fullrights, $inherit, $propagation, "Allow")))
    #Remove Inheritance from the root user folder
    $DirACL.SetAccessRuleProtection($True, $False) #SetAccessRuleProtection(block inheritance?, copy parent ACLs?)
    #Set permissions on User Directory
    Set-Acl -aclObject $DirACL -path $Locked.Fullname
    Write-Host "commencer" -NoNewLine
    ##############Restore admin access & then restore file/folder inheritance on all subitems
    #create a template ACL with inheritance re-enabled; this will be stamped on each subitem to re-establish the file structure with inherited ACLs only.
    #$NewOwner = New-Object System.Security.Principal.NTAccount("$domainName","$Locked.name") #ideally I would error check this.
    $NewOwner = New-Object System.Security.Principal.NTAccount("$domainName","$Locked") #ideally I would error check this.
    $subFileACL = New-Object System.Security.AccessControl.FileSecurity
    $subDirACL = New-Object System.Security.AccessControl.DirectorySecurity
    $subFileACL.SetOwner($NewOwner)
    $subDirACL.SetOwner($NewOwner)
    ######## Enable inheritance ($False) and not copy of parent ACLs ($False)
    $subFileACL.SetAccessRuleProtection($False, $False) #SetAccessRuleProtection(block inheritance?, copy parent ACLs?)
    $subDirACL.SetAccessRuleProtection($False, $False) #SetAccessRuleProtection(block inheritance?, copy parent ACLs?)
    #####loop through subitems
    $subdirs = Get-ChildItem -path $Locked.Fullname -force -recurse #force is necessary to get hidden files/folders
    foreach ($subitem in $subdirs) {
    #take ownership to insure ability to change permissions
    #Then set desired ACL
    if ($subitem.Attributes -match "Directory") {
    # New, blank Directory ACL with only Owner set
    $blankdirAcl = New-Object System.Security.AccessControl.DirectorySecurity
    $blankdirAcl.SetOwner([System.Security.Principal.NTAccount]'BUILTIN\Administrators')
    #Use SetAccessControl to reset Owner; Set-Acl will not work.
    $subitem.SetAccessControl($blankdirAcl)
    #At this point, Administrators have the ability to change the directory permissions
    Set-Acl -aclObject $subDirACL -path $subitem.Fullname -ErrorAction Stop
    } Else {
    # New, blank File ACL with only Owner set
    $blankfileAcl = New-Object System.Security.AccessControl.FileSecurity
    $blankfileAcl.SetOwner([System.Security.Principal.NTAccount]'BUILTIN\Administrators')
    #Use SetAccessControl to reset Owner; Set-Acl will not work.
    $subitem.SetAccessControl($blankfileAcl)
    #At this point, Administrators have the ability to change the file permissions
    Set-Acl -aclObject $subFileACL -path $subitem.Fullname -ErrorAction Stop
    Write-Host "." -NoNewline
    Write-Host "fin."
    Write-Host "Script Complete."
    I hope you find this useful.
    Thank you,
    Tony
    Final Thought: There are great non-PS tools like
    Set-Acl and takeown which are external to PS & can also do the job wonderfully.  It may be much simpler to call those tools than recreate the wheel in pure
    code.  Feel free to use whatever best suits your time, scope & cost.

Maybe you are looking for

  • Error in Query Execution : SQL Error: 1110

    Dear Experts,      We did the system copy from production to Sandbox system. Executing one query got terminated with the following error.      Error SQL Error: 1110      Abort System error in program SAPLRRK0 and form RSRDR;SRRK0F30-01-      I copy t

  • How do I remove Outlook 2013 profile that refers to Exchange Server 2003, Outlook won't start

    I have Office 2013 Pro preinstalled on my new Windows 8.1 (64bit) machine. I am on a domain with a Small Business Server 2003.  The server has Exchange 2003 installed on it but I've never used it. I use Google Apps for Business for my email.  I click

  • Check Printing SAPSCRIPT

    Check Printing Posted: Sep 2, 2005 1:34 AM        Reply      E-mail this post  Hi All, I am working on check printing in SAPSCRIPT. I am modifying the standard program RFFOUS_C. Can anyone give me the the technical flow of this standard program. rega

  • Deploying icons as jar file in Forms 9i

    We (Cancer Research UK) don't quite understand what is happening - We followed the guidelines in the white paper "Oracle 9IAs Forms Services - How to Deploy Icons" to deploy the images in a jar file: Altered the formsweb.cfg file to contain archive_j

  • Exporting to play in Windows Powerpoint using 4.04 - spec

    I'm trying to export from FCP X by sending clips to Compressor 4.04 however the online lessons on lynda.com - my go-to source - and in Compressor manuals don't appear up-to-date with the actual latest revisions and I'm confused about whether to use Q