Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. Change Permissions, Skip on Error

Change Permissions, Skip on Error

Scheduled Pinned Locked Moved System Admin
csharpcomhelpquestion
4 Posts 2 Posters 19 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GenJerDan
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • G GenJerDan

      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

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      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.

      G 1 Reply Last reply
      0
      • J Jochen Arndt

        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.

        G Offline
        G Offline
        GenJerDan
        wrote on last edited by
        #3

        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

        J 1 Reply Last reply
        0
        • G GenJerDan

          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

          J Offline
          J Offline
          Jochen Arndt
          wrote on last edited by
          #4

          Thank you for the update. It is always good to find a ready-to-use solution which might be also helpful for others.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups