Difference between revisions of "Powershell Remote Access"

From Michael's Information Zone
Jump to navigation Jump to search
Line 1: Line 1:
<ref>https://stackoverflow.com/questions/21548566/how-to-add-more-than-one-machine-to-the-trusted-hosts-list-using-winrm</ref>
+
<ref>https://stackoverflow.com/questions/21548566/how-to-add-more-than-one-machine-to-the-trusted-hosts-list-using-winrm</ref><ref>https://www.howtogeek.com/117192/how-to-run-powershell-commands-on-remote-computers/</ref>
 +
On server
 
<pre>
 
<pre>
 
enable-psremoting -force
 
enable-psremoting -force
 
winrm set winrm/config/client '@{TrustedHosts="machineA,machineB"}'
 
winrm set winrm/config/client '@{TrustedHosts="machineA,machineB"}'
 +
</pre>
 +
On client
 +
<pre>
 +
Enter-PSSession -ComputerName COMPUTER -Credential USER
 
</pre>
 
</pre>

Revision as of 15:08, 14 June 2017

[1][2] On server

enable-psremoting -force
winrm set winrm/config/client '@{TrustedHosts="machineA,machineB"}'

On client

Enter-PSSession -ComputerName COMPUTER -Credential USER