PowerShell: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
Enable-PSRemoting -Force | Enable-PSRemoting -Force | ||
Set-Item WSMan:\localhost\Client\TrustedHosts * | Set-Item WSMan:\localhost\Client\TrustedHosts * | ||
winrm s winrm/config/client '@{TrustedHosts="10.19.83.10"}' | winrm s winrm/config/client '@{TrustedHosts="10.19.83.10,10.19.83.14"}' | ||
Restart-Service WinRM | Restart-Service WinRM | ||
Get-Service WinRM | Get-Service WinRM |
Revision as of 07:21, 21 November 2020
Enable-PSRemoting -Force
Set-Item WSMan:\localhost\Client\TrustedHosts *
winrm s winrm/config/client '@{TrustedHosts="10.19.83.10,10.19.83.14"}'
Restart-Service WinRM
Get-Service WinRM
Test-WsMan 10.19.83.10
Invoke-Command -ComputerName 10.19.83.10 -ScriptBlock { Get-ChildItem C:\ } -credential academia
Enter-PSSession -ComputerName 10.19.83.10 -Credential academia
Knowledge
Get-Service WinRM
Restart-Service WinRM
Enable-PSRemoting -Force
Get-Item WSMan:\localhost\Client\TrustedHosts
Set-Item WSMan:\localhost\Client\TrustedHosts *