Directory Access Denied but cannot record directory name

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Forums Archives Forums Archives 5 years, 5 months ago.

  • Author
    Posts
  • #5720

    by notarat at 2013-03-25 04:18:56

    I'm running my script that lists in a CSV File all files on a network drive that are over 6 years old. That part's working fine.

    Get-ChildItem C: -recurse -errorvariable strOOPS -errorAction continue |
    Where-Object { $_.LastWriteTime -lt ([DateTime]::Now.AddDays(-2190))} |
    export-csv C:\outputfiles\oldfiles.csv -notype
    $strOOPS | Add-Content c:\outputfiles\errors.csv

    When I run the script against local "D:" drive and it encounters a folder that I do not have permissions to access, It lists them. However, when I am running the script against a network drive like "W:", I do not get a CSV export of the folders I don't have permissions to access. I receive the following error:

    The specified network name is no longer available.

    The specified network name is no longer available.

    The specified network name is no longer available.

    The specified network name is no longer available.

    The specified network name is no longer available.

    The specified network name is no longer available.

    Any idea what i may be doing wrong? When I test it on my local drive it works fine.

    by DonJ at 2013-03-25 06:26:42

    That's just how the underlying network redirector is responding. For a share-based folder, you also need enumeration rights (ABE is usually turned on) and so that's what it does.

You must be logged in to reply to this topic.