Get-ACL Error Continuation and Server List

Hi All,
I'm conducting an audit of all folders on network shares that are spread accross several servers.  I'm very new to PS but from my research I have put together the following:
Get-ChildItem \\server\share -Recurse | Where-Object{($_.psiscontainer)} | Get-Acl | select-object path -expandproperty access | Export-CSV results.csv
This has been working ok but I hit an 'unauthrosied operation' error when it trys a folder that I do not have permissions to (i'm running as domain admin).  That's fine but it's a termination error which I can't seem to work around.  I have tried
things like -ErrorAction SilentlyContinue but it just stops without producing the error and will not continue.  I have also tried a try and catch which I found on Technet but can't seem to get the -recurse to work:
$fse = Get-ChildItem \\server\share -recurse | Where-Object{($_.psiscontainer)}
$fse | %{$f=$_; try { get-acl $_.FullName } catch { Write-Warning "Failed to access $($f.FullName)" }}
I've tried my best to get the code to continue after the error but I just can't see what I am doing wrong.  Any ideas?
Also, I have many many shares to test which are all listed in a spreadsheet.  I'm been trying to research how I can use this spreadsheet instead of writing in the server and share for every one I want to test.  However this is now going way above
my head and I can't get anywhere near to a semi-working example.  Is there a way I can use the above to reference a spreadsheet and test each share that is listed?
Many Thanks.

OK I have got it to run by using
try
Import-csv .\test.csv | % {Get-ChildItem $_.Servername -Recurse -ErrorAction Stop| Where-Object{($_.psiscontainer)} |
Get-Acl | select-object path -expandproperty access | Export-CSV results.csv }
}Catch{
$_.Exception
continue;
However it still terminates when it gets to a folder it does not have the permission to access the ACL.
I'd add a separate ForEach-Object call for each object returned from Get-ChildItem. Does this work?
Import-Csv .\test.csv | ForEach-Object {
Get-ChildItem $_.Servername -Recurse | Where-Object { $_.PSIsContainer } | ForEach-Object {
try {
$Path = $_.FullName
$_ | Get-Acl | Select-Object Path -ExpandProperty Access
catch {
# You can ignore this, write a warning, send this to a separate file, etc
Write-Error ("Error calling Get-Acl on '{0}': {1}" -f $Path, $_.Exception.Message)
} | Export-Csv results.csv
That will simply write any errors to the screen. Is that good enough, or did you want to store them somewhere?

Similar Messages

  • I've only had my iphone 5s for a week. I keep getting an error message of "Server has stopped responding."  I need the server to work. Does anyone know if there is a "fix" for the problem? Other wise, I probably best return for a refund and get a Samsung.

    I've only had my iphone 5s for a week. I keep getting an error message of "Server has stopped responding."  I need the server to work. Does anyone know if there is a "fix" for the problem? Other wise, I probably best return for a refund and get a Samsung.  Thanks

    sandyzotz wrote:
    Other wise, I probably best return for a refund and get a Samsung.
    Unlikely.  Based on the complete lack of detail of the issue provided it is entirely possible the same issue would occur.
    Unless and until the user provides some actual details of the problem, there is nothing the indicate that the issue is with the iPhone.

  • I am trying to finalize a movie project and I get an "error in user parameter list" message.  What does that mean, and how can I fix it?

    I am trying to finalize a movie project and I get an "error in user parameter list" message.  What does that mean, and how can I fix it?

    what movie editing software are you using?

  • Face time no longer works for me. Lost my contacts even! Keep trying to change PWD and keep getting same error message: The server encountered an error processing registration. Please try again later. Can you advise? Thanks!

    Face time no longer works for me. Lost my contacts even! Keep trying to change PWD and keep getting same error message: The server encountered an error processing registration. Please try again later. Can you advise? Thanks!

    Face time no longer works for me. Lost my contacts even! Keep trying to change PWD and keep getting same error message: The server encountered an error processing registration. Please try again later. Can you advise? Thanks!

  • [svn:bz-trunk] 14330: BLZ-476 : Getting different error message in server' s servlet log and console log when class is not of expected type.

    Revision: 14330
    Revision: 14330
    Author:   [email protected]
    Date:     2010-02-22 10:03:03 -0800 (Mon, 22 Feb 2010)
    Log Message:
    BLZ-476 : Getting different error message in server's servlet log and console log when class is not of expected type.
    QA: no
    Doc: no
    checkin test : pass
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-476
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/MessageBrokerServlet.java

    Hi, wbracken ,
    As known, there are 2 different questions I raised.
    Regarding the reply for the second one (Nothing to do with Chinese), I noticed there are several similar issues found in this forum, and it seems no response could solve my that problem. The related methods and classes were also well check, as well as the parameters put.
    Any way, your reponse was appreciated.
    Thank you for the help.

  • [svn:bz-trunk] 14341: BLZ-476 : Getting different error message in server' s servlet log and console log when class is not of expected type.

    Revision: 14341
    Revision: 14341
    Author:   [email protected]
    Date:     2010-02-22 13:19:46 -0800 (Mon, 22 Feb 2010)
    Log Message:
    BLZ-476 : Getting different error message in server's servlet log and console log when class is not of expected type.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-476
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/MessageBrokerServlet.java
        blazeds/trunk/modules/core/src/flex/messaging/util/ClassUtil.java

    Hi, wbracken ,
    As known, there are 2 different questions I raised.
    Regarding the reply for the second one (Nothing to do with Chinese), I noticed there are several similar issues found in this forum, and it seems no response could solve my that problem. The related methods and classes were also well check, as well as the parameters put.
    Any way, your reponse was appreciated.
    Thank you for the help.

  • I want to upgrade the software (currently I have Mac OS X 10.6.4) but when the mac is downloading the new version i get an error message and is not possible get the most updated software: Mac OS X 10.6.8 or either the most recent itunes why?!?!?!

    I want to upgrade the software (currently I have Mac OS X 10.6.4) but when the mac is downloading the new version i get an error message and is not possible get the most updated software: Mac OS X 10.6.8 or either the most recent itunes why?!?!?!

    Then you either have a network problem or a hardware problem or a corrupted hard drive. You might try:
    Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    You can also try downloading from another computer on a different network connection.

  • Have downloaded new Lightroom 5.4 from CC. When trying to launch am getting following error message and then Lightroom crashes: "an error occurred when attempting to change modules". Can't find a thread which relates to this error message.

    Have downloaded new Lightroom 5.4 from CC. When trying to launch am getting following error message and then Lightroom crashes: "an error occurred when attempting to change modules". Can't find a thread which relates to this error message.

    Hi 99jon,
    Many thanks for that. Had been going through this list yesterday and now again today:
    Ref  Solution 1: Lightroom is at its latest update
    Ref  Solution 2: It's interesting how I cannot find the Preferences file anywhere on my mac. (new mac pro, OS 10/9.2) . . .
    Ref  Solution 3: Lightroom doesn't allow me to do anything after the error message appears
    Ref  Solution 4: don't have any Nik Software plug-ins
    Ref  Solution 5: checked permissions and changed all to "Read & Write" - makes no difference
    Ref  Solution 6: I don't have a different user account on my mac.
    Not sure what else to do.

  • In my ipad, I m getting playback error continuously on YouTube

    getting playback error continuously in YouTube in my ipad

    First  try a reset. Press and hold both the home and power buttons 10-15 seconds till the Apple logo appears. Release both buttons. Wait 15-20 seconds till your iPad starts on it's own.
    If it still doesn't work try deleting and reinstalling the YouTube app.
    If it still doesn't work contact youTube to see if they can help.

  • I keep getting this error message and the spinning wheel on all websites, any fix? (Webpages are not responding, so loading cannot be stopped. Do you want to force reload this page and all pages in other tabs and windows?)

    I keep getting this error message and the spinning wheel on all websites, any fix? (Webpages are not responding, so loading cannot be stopped. Do you want to force reload this page and all pages in other tabs and windows?)

    Hi, this has worked for a few...
    Make a New Location, Using network locations in Mac OS X ...
    http://support.apple.com/kb/HT2712
    10.7…
    System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
    10.5.x/10.6.x/10.7.x instructions...
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list.
    Instead of joining your Network from the list, click the WiFi icon at the top, and click join other network. Fill in everything as needed.
    For 10.5/10.6, System Preferences>Network, unlock the lock if need be, highlight the Interface you use to connect to Internet, click on the advanced button, click on the DNS tab, click on the little plus icon, then add these numbers...
    208.67.222.222
    208.67.220.220
    Click OK.

  • I have just bought an iPhone 5 and it won't sync to iTunes.  It says it needs  iTunes 10.7, which I have downloaded and installed.  I still get the error message and looking at "about iTunes" it says 10.6.3.  What do I do??

    I have just bought an iPhone 5 and it won't sync to iTunes.  It says it needs  iTunes 10.7, which I have downloaded and installed.  I still get the error message and looking at "about iTunes" it says 10.6.3.  What do I do??

    Perhaps check to see if you're accidentally running two different versions of iTunes. There's some information on troubleshooting that in the Opening iTunes section of the following document:
    Troubleshooting iTunes installation on Mac OS X

  • My macbook is loaded with microsoft work and every time I try and open the program I get an error reading and it will not open.  Powerpoint and the other applications still respond!

    my macbook is loaded with microsoft word for macs and every time I try and open the program I get an error reading and it will not open. This is what it says:
    The application Microsof Word quit eunexpectedly.  Powerpoint and the other applications still respond!

    The joys of Microsoft!
    Maybe the preferences file is corrupted.  You should be able to find the Word preferences file in the folder:
    your user name/Library/Preferences
    Its name is com.microsoft.Word.plist
    I suggest you drag this another folder and try Word again. 
    If that doesn't work then you might find clearing the cache files will fix the problem.  You can do this manually but I never bother. Instead I use a program like Snow Leopard Cache Cleaner (shareware) or Onyx (free). These programs do lots of other maintenance jobs so it's worth having at least one of them.
    Bob

  • I run windows 7/8 and lightroom 5.7  i am getting an error message and here it is " lightroom encountered and error when reading from its preview cache and needs to quit". I am getting this message repeatly.  What do I need to do to fix it.

    I run windows 7/8 and lightroom 5.7  I am getting an error message and here it is  " lightroom encountered an error when reading from its preview cache and needs t quit"    How do I fix this.

    THANKS
    Hank Wilkinson
    Please visit my web site  <http://www.hankwilkinson.com/> www.hankwilkinson.com for the latest of my photos
    For information on any of these photos please email me or call 612-756-9970

  • My Ipod is stuck in recovery mode with the plug in to itunes thing on the screen I tryed to restore it but I keep getting a error 28 and I tryed to do the reset thing but it did not work what do I do?

    My Ipod is stuck in recovery mode with the plug in to itunes thing on the screen I tryed to restore it but I keep getting a error 28 and I tryed to do the reset thing but it did not work what do I do?

    Hi,
    You could see if this helps...
    DFU Mode / Unable to Update or Restore
    http://support.apple.com/kb/HT1808
    DFU Mode
    Open iTunes and Connect the iPod to your Mac
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time
    After 10 Seconds release the Sleep/Wake Button until iTunes tells you it has Detected an iPod in Recovery Mode...
    The Phone Screen will remain Black... Now Restore.
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414

  • I had iTunes installed on my windows desktop computer and it suddently disappeared. I tried to reinstall it but get an error message and it won't reinstall

    I had iTunes installed on my windows desktop computer and it suddently disappeared. I tried to reinstall it but get an error message and it won't reinstall

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

Maybe you are looking for