Error Accessing UNC through remote machine

Welcome Forums General PowerShell Q&A Error Accessing UNC through remote machine

Viewing 1 reply thread
  • Author
    Posts
    • #209739
      Participant
      Topics: 1
      Replies: 0
      Points: 12
      Rank: Member

      I’m running PowerShell as a domain administrator on my local PC

      Invoke-Command -ComputerName $computer -ScriptBlock {Copy-Item -Path ‘\\fileshare\folder\filename.txt’ -Destination ‘C:\temp\’}

      I get the following errors

      Access is denied
      + CategoryInfo : PermissionDenied: (\\fileshare\folder:String) [Copy-Item], UnauthorizedAccessException
      + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.Copy-ItemCommand
      + PSComputerName : test

      Cannot find path ‘\\fileshare\folder’ because it does not exist.
      + CategoryInfo : ObjectNotFound: (\\fileshare\folder:String) [Copy-Item], ItemNotFoundException
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.Copy-ItemCommand
      + PSComputerName : test

      If I try the copy-item command on the server directly it works fine, no errors.  Why do I get the errors when I try to run from my PC?

    • #209742
      Participant
      Topics: 6
      Replies: 93
      Points: 428
      Helping Hand
      Rank: Contributor

      The old Kerberos double hop may be your issue:

      https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/ps-remoting-second-hop?view=powershell-7

      In your case, whatever “server” hosts the fileshare would be Server C

Viewing 1 reply thread
  • You must be logged in to reply to this topic.