Run any command remotely:
Invoke-Command -ComputerName localhost -ScriptBlock { 7z }
Ref: http://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/
PS D:\a_team\chef-repo> Test-WsMan CoolHost
PS D:\a_team\chef-repo> Invoke-Command -ComputerName CoolHost -ScriptBlock { Get-ChildItem C:\ }
Run a Full Remote Session
from> Enter-PSSession -ComputerName {hostname}
Enabled Credential Delegation (Add Network Resource Access to Remote Sessions)
local> Enable-WSManCredSSP Client –DelegateComputer {fqdnOfHost}
remote>
CredSSP Authentication Configuration for WS-Management
CredSSP authentication allows the user credentials on this computer to be sent to a remote computer. If you use CredSSP
authentication for a connection to a malicious or compromised computer, that computer will have access to your user
name and password. For more information, see the Enable-WSManCredSSP Help topic.
Do you want to enable CredSSP authentication?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
cfg : http://schemas.microsoft.com/wbem/wsman/1/config/client/auth
lang : en-US
Basic : true
Digest : true
Kerberos : true
Negotiate : true
Certificate : true
CredSSP : true
New-PSSession : [targetHost] Connecting to remote server targetHost failed with the
following error message : The WinRM client cannot process the request. CredSSP authentication is currently disabled in
the client configuration. Change the client configuration and try the request again. CredSSP authentication must also
be enabled in the server configuration. Also, Group Policy must be edited to allow credential delegation to the target
computer. Use gpedit.msc and look at the following policy: Computer Configuration -> Administrative Templates ->
System -> Credentials Delegation -> Allow Delegating Fresh Credentials. Verify that it is enabled and configured with
an SPN appropriate for the target computer. For example, for a target computer name "myserver.domain.com", the SPN can
be one of the following: WSMAN/myserver.domain.com or WSMAN/*.domain.com For more information, see the
about_Remote_Troubleshooting Help topic.