PowerShell: Difference between revisions
Jump to navigation
Jump to search
Line 45: | Line 45: | ||
| valign="top" | | | valign="top" | | ||
* [https://abouconde.com/2020/07/06/winrm-firewall-exception-will-not-work-since-one-of-the-network-connection-types-on-this-machine-is-set-to-public-change-the-network-connection-type-to-either-domain-or-private-and-try-again/ Change the network connection type to either Domain or Private] | * [https://abouconde.com/2020/07/06/winrm-firewall-exception-will-not-work-since-one-of-the-network-connection-types-on-this-machine-is-set-to-public-change-the-network-connection-type-to-either-domain-or-private-and-try-again/ Change the network connection type to either Domain or Private] | ||
* [https://www.hurryupandwait.io/blog/fixing-winrm-firewall-exception-rule-not-working-when-internet-connection-type-is-set-to-public Hacks for WinRM Firewall exception rule for Public] | |||
|} | |} |
Revision as of 08:37, 21 November 2020
Get-Service WinRM
Restart-Service WinRM
Enable-PSRemoting -Force
Set-Item WSMan:\localhost\Client\TrustedHosts *
WinRM s winrm/config/client '@{TrustedHosts="10.19.83.10,10.19.83.14"}'
WinRM quickconfig
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 *
Set-Item WSMan:\localhost\Client\TrustedHosts -Force -Value 10.19.83.10
$s = New-PSSession -ComputerName "10.19.83.10" -Credential(Get-Credential)
Invoke-Command -Session $s -ScriptBlock { Get-ChildItem C:\ }
Invoke-Command -Session $s -ScriptBlock { Get-Service }
Get-NetConnectionProfile
Set-NetConnectionProfile -InterfaceIndex 10 -NetworkCategory Private