Skip to content

Instantly share code, notes, and snippets.

@clong
Last active August 3, 2022 20:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save clong/959bc5abe14cb5989c985d4156b5c335 to your computer and use it in GitHub Desktop.
Save clong/959bc5abe14cb5989c985d4156b5c335 to your computer and use it in GitHub Desktop.
powershell.exe -c "Set-NetConnectionProfile -InterfaceAlias Ethernet -NetworkCategory Private"
powershell.exe -c "Enable-PSRemoting -Force"
winrm quickconfig -q
winrm quickconfig -transport:http
powershell.exe -c "winrm set winrm/config '@{MaxTimeoutms=\`"1800000\`"}'"
powershell.exe -c "winrm set winrm/config/winrs '@{MaxMemoryPerShellMB=\`"800\`"}'"
powershell.exe -c "winrm set winrm/config/service '@{AllowUnencrypted=\`"true\`"}'"
powershell.exe -c "winrm set winrm/config/service/auth '@{Basic=\`"true\`"}'"
powershell.exe -c "winrm set winrm/config/client/auth '@{Basic=\`"true\`"}'"
netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new enable=yes action=allow remoteip=any
powershell.exe -c "Restart-Service winrm"
netsh advfirewall firewall add rule name="Port 5985" dir=in action=allow protocol=TCP localport=5985
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment