Change Permissions, Skip on Error
-
We'll be needing to change the ownership and permissions on a few hundred thousand folders & files. Can it be done in PS (or other) in such a way that any errors encountered are ignored (and logged?) so the process doesn't come to a screeching halt? I fully expect for it to find folders that the creator locked down so tightly that they will require special attention on an individual basis. I've websearched, but either I'm asking in the wrong way, or no one has ever needed to do this. (Doubtful) For obvious reasons, I refuse to use the GUI to do it. ;P
We won't sit down. We won't shut up. We won't go quietly away. YouTube, VidMe and My Mu[sic], Films and Windows Programs, etc. and FB
-
We'll be needing to change the ownership and permissions on a few hundred thousand folders & files. Can it be done in PS (or other) in such a way that any errors encountered are ignored (and logged?) so the process doesn't come to a screeching halt? I fully expect for it to find folders that the creator locked down so tightly that they will require special attention on an individual basis. I've websearched, but either I'm asking in the wrong way, or no one has ever needed to do this. (Doubtful) For obvious reasons, I refuse to use the GUI to do it. ;P
We won't sit down. We won't shut up. We won't go quietly away. YouTube, VidMe and My Mu[sic], Films and Windows Programs, etc. and FB
It should be possible using PS but I have not done so far. You probably want to call Set-Acl[^] for each single file and directory within a try a catch block (about_Try_Catch_Finally | Microsoft Docs[^]). So errors will not let your script terminate and can be logged.
-
It should be possible using PS but I have not done so far. You probably want to call Set-Acl[^] for each single file and directory within a try a catch block (about_Try_Catch_Finally | Microsoft Docs[^]). So errors will not let your script terminate and can be logged.
Found this, which looks like it will do it all. :) Changing Ownership of File or Folder Using PowerShell | Learn Powershell | Achieve More[^]
We won't sit down. We won't shut up. We won't go quietly away. YouTube, VidMe and My Mu[sic], Films and Windows Programs, etc. and FB
-
Found this, which looks like it will do it all. :) Changing Ownership of File or Folder Using PowerShell | Learn Powershell | Achieve More[^]
We won't sit down. We won't shut up. We won't go quietly away. YouTube, VidMe and My Mu[sic], Films and Windows Programs, etc. and FB
Thank you for the update. It is always good to find a ready-to-use solution which might be also helpful for others.