You have to enable CredSSP
(see: Enable-WSManCredSSP) on both the client and server (necessary for this double hop authentication).
First enable on your client to server direction by running this on your machine:
Enable-WSManCredSSP -Role "Client" -DelegateComputer "EABP01IGCHEA01"
Then on your server EABP01IGCHEA01
, enable the Server role so that it can act as a delegate:
Enable-WSManCredSSP -Role "Server"
Then you have to explicitly specify the authentication method as CredSSP
as it won't connect with it by default:
Invoke-Command -ComputerName EABP01IGCHEA01 -Authentication Credssp -Credential $cred -ScriptBlock {Get-Content "\Ebrfile01csITINFRA IGNIO SOXvdi NS list 1.csv"}
Please note the security implications of enabling CredSSP:
Caution:
CredSSP authentication delegates the user credentials from the local
computer to a remote computer. This practice increases the security
risk of the remote operation. If the remote computer is compromised,
when credentials are passed to it, the credentials can be used to
control the network session.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…