In PowerShell how to copy files from a Remote PSsession to another Windows server

前端 未结 3 866
慢半拍i
慢半拍i 2021-01-21 06:59

I am trying to copy a folder from one remote server to another inside a PSSession, it\'s giving errors like access is denied. I have admin privileges to both of the servers. If

相关标签:
3条回答
  • 2021-01-21 07:20

    I believe you are facing the "double hop" problem, which is solved by using CredSSP

    0 讨论(0)
  • 2021-01-21 07:32

    You are facing the "Double Hop" problem. Run this on the SQL computer

    Enable-WSManCredSSP -Role Server 
    

    and run this on Server B

    Enable-WSManCred -Role Client -DelegateComputer * 
    

    then when you enter the remote session do

    Enter-PSSession -ComputerName sql -Authentication Credssp -Credential (Get-Credential)
    

    Hope this helps.

    If you sneezed during reading this answer, Bless your face.

    0 讨论(0)
  • 2021-01-21 07:36

    In case you would like to read more about the "Double Hop" issue, refer to this article: Multi-Hop Support in WinRM

    0 讨论(0)
提交回复
热议问题