Easy steps to enable Powershell Remoting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Enable PSRemoting on Source Machine | |
# Enable the PSRemoting on all interfaces even the Public Network Interfaces | |
Enable-PSRemoting -Force -SkipNetworkProfileCheck -Verbose | |
# Allow only remote access from specific computers | |
Set-Item WSMan:\localhost\Client\TrustedHosts -Value '[List of IPs or Computer Names to where commands will be sent]' | |
# Restart the WinRM service | |
Restart-Service WinRM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Enable PSRemoting on Target Machine | |
# Enable the PSRemoting on all interfaces even the Public Network Interfaces | |
Enable-PSRemoting -Force -SkipNetworkProfileCheck -Verbose | |
# Allow only remote access from specific computers | |
Set-Item WSMan:\localhost\Client\TrustedHosts -Value '[List of IPs or Computer Names from where commands originate]' | |
# If the remote commands are sent from computers not on the same workgroup, open the WinRM Public interface in the firewall | |
Set-NetFirewallRule –Name "WINRM-HTTP-In-TCP-PUBLIC" –RemoteAddress Any | |
# Configure the machine to accept remote commands | |
Set-WSManQuickConfig | |
# Restart the WinRM service | |
Restart-Service WinRM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment