Skip to content

Instantly share code, notes, and snippets.

@Larswa
Last active December 5, 2025 09:27
Show Gist options
  • Select an option

  • Save Larswa/4b901b6da6bedc73f336d302fb76a7dd to your computer and use it in GitHub Desktop.

Select an option

Save Larswa/4b901b6da6bedc73f336d302fb76a7dd to your computer and use it in GitHub Desktop.
# WinRM
Enable-PSRemoting -Force
Set-Item WSMan:\localhost\Service\Auth\Basic -Value $true
Set-Item WSMan:\localhost\Service\AllowUnencrypted -Value $true
New-NetFirewallRule -Name "WinRM-HTTP" -DisplayName "WinRM HTTP" -Protocol TCP -LocalPort 5985 -Action Allow
# SSH
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Start-Service sshd
Set-Service -Name sshd -StartupType Automatic
New-NetFirewallRule -Name "SSH" -DisplayName "SSH" -Protocol TCP -LocalPort 22 -Action Allow
# RDP
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name "fDenyTSConnections" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
# ICMP (ping)
New-NetFirewallRule -Name "ICMP-In" -DisplayName "ICMP In" -Protocol ICMPv4 -Action Allow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment