Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 0
Restart-Service TermService -Force
Get-NetTCPConnection -LocalPort 3389 -ErrorAction SilentlyContinue | Format-Table LocalAddress, LocalPort, State, OwningProcess
Get-WinEvent -LogName System -MaxEvents 30 | Where-Object {$_.ProviderName -like "*TermService*" -or $_.ProviderName -like "*Remote*" -or $_.Id -in 1001,1002,1003,2045} | Format-List TimeCreated, Id, Message
Get-WinEvent -LogName 'Microsoft-Windows-TerminalServices-LocalSessionManager/Operational' -MaxEvents 20 -ErrorAction SilentlyContinue | Format-List TimeCreated, Id, Message
gpedit.msc
gpupdate /force
Restart-Service TermService -Force
netstat -ano | findstr 3389
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name fEnableWinStation -ErrorAction SilentlyContinue