Last active
May 22, 2025 02:34
-
-
Save hunzo/c9d90ac73ec0b2cb325ce8bd8b0de0eb to your computer and use it in GitHub Desktop.
RDP powershell
This file contains hidden or 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
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Value 0 | |
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Value 0 | |
Enable-NetFirewallRule -DisplayGroup "Remote Desktop" | |
New-NetFirewallRule ` | |
-DisplayName "Allow RDP from All Networks (3389)" ` | |
-Direction Inbound ` | |
-Protocol TCP ` | |
-LocalPort 3389 ` | |
-Action Allow ` | |
-Profile Domain,Private,Public ` | |
-EdgeTraversalPolicy Allow | |
netstat -an | Select-String ":3389" | |
Get-NetConnectionProfile | |
Restart-Service -Name TermService -Force | |
# powershell -ExecutionPolicy Bypass -File .\rdp.ps1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment