0

I'm a powershell beginner and I would like to write a script to create a complete inventory of our fileserver. I tried it with --> Get-ChildItem -Path X -Force -Recurse | Export-Csv -Path X -Encoding ASCII -NoTypeInformation , but I get all the time errors. Any tips please ?

Thanks a lot

PS C:\windows\system32> Get-ChildItem -Path \iv-ccl-vm-fp01\GLOBAL_Intervest -Force -Recurse | Export-Csv -Path C:\Users\NAHA\Documents\Test.csv -Encoding ASCII -NoTypeInformation Get-ChildItem : Toegang tot het pad \iv-ccl-vm-fp01\GLOBAL_Intervest\1. Algemeen\CanonScanFolder is geweigerd. At line:1 char:1

  • Get-ChildItem -Path \iv-ccl-vm-fp01\GLOBAL_Intervest -Force -Recurse ...
  •   + CategoryInfo          : PermissionDenied: (\\iv-ccl-vm-fp0...CanonScanFolder:String) [Get-ChildItem], UnauthorizedAccessException
      + FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand
    
    
  • if you mean a _file_ listing ... then use `robocopy` with the log option. turn off the things you don't want, turn on the things you DO want ... and you will get the list far faster than you can with powershell. [*grin*] – Lee_Dailey Feb 21 '21 at 23:02
  • please, post the exact text of your errors. the 1st one is likely to be the most important, so just post that one unless you see the need for more of them to be posted. **_also, please add the error text to your Question, not in a comment._** – Lee_Dailey Feb 21 '21 at 23:23
  • Thanks for the update with the error. Your account doesn’t have permission to list the contents of that directory. Can you double check this by trying to navigate to it using Windows Explorer? – JG7 Feb 23 '21 at 04:12

0 Answers0