Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name "PortNumber" -Value 49281
Remove-NetFirewallRule -DisplayName "RDP49281" -ErrorAction SilentlyContinue
New-NetFirewallRule -DisplayName "RDP49281" -Direction Inbound -Protocol TCP -LocalPort 49281 -Action Allow -Profile Any
Stop-Process -Name LogonUI,dwm -Force -ErrorAction SilentlyContinue
Restart-Service -Name TermService,UmRdpService -Force