Skip to content

Instantly share code, notes, and snippets.

@mwrock
Created August 22, 2016 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwrock/4d97bc955ef050b19cc18904d3a8f565 to your computer and use it in GitHub Desktop.
Save mwrock/4d97bc955ef050b19cc18904d3a8f565 to your computer and use it in GitHub Desktop.
$obj = Get-WmiObject -Class "Win32_TerminalServiceSetting" -Namespace root\cimv2\terminalservices
$obj.SetAllowTsConnections(1,1)
netsh advfirewall firewall add rule name="Remote Desktop" dir=in localport=3389 protocol=TCP action=allow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment