RDP Security Checklist: 10 Best Practices and How to Verify Each
Ten Remote Desktop security practices, each with a command that shows whether your Windows server actually follows it. Run the checks in ten minutes.
3 min readBy Smita
Reviewed by the AmazingRDP technical team

A private Windows server where every one of these settings is yours to check and change. See Windows VPS from $8.99
Lists of Remote Desktop security advice are easy to find and easy to nod along to. This one is built to be run: each of the ten practices comes with a command that shows what your server really does today. Open PowerShell as administrator on the server and go down the list. Why each practice matters is explained in the seven real risks of RDP; how to change the settings is in securing RDP on your server.
These checks are for a server you administer. On a shared remote desktop the server is ours to secure and you cannot run them.
1. Network Level Authentication is on
(Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp').UserAuthentication
Good: 1. With NLA, the login is checked before the server creates a desktop.
2. Accounts lock after failed logins
net accounts
Good: "Lockout threshold" shows a number such as 5, not "Never". Set it with net accounts /lockoutthreshold:5 /lockoutduration:15 /lockoutwindow:15.
3. Only the right people may log in remotely
Get-LocalGroupMember "Remote Desktop Users"
Get-LocalGroupMember "Administrators"
Good: every name is a person you know who still needs access. Remove the rest.
4. No stale or default accounts
Get-LocalUser | Select-Object Name, Enabled, LastLogon, PasswordLastSet
Good: Guest is disabled; no enabled account that nobody has used in months; ideally the built-in Administrator is renamed or disabled and you work with an account of your own.
5. The firewall limits who can reach Remote Desktop
Get-NetFirewallRule -DisplayGroup "Remote Desktop" -Enabled True | Get-NetFirewallAddressFilter | Select-Object RemoteAddress
Good: specific addresses, or the range of your VPN. Any means the whole internet can try. If you connect from changing addresses, a VPN in front is the answer: understanding VPNs.
6. Windows is up to date
Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 5
(Get-CimInstance Win32_OperatingSystem).Caption
Good: the newest update is from the current or the previous month, and the Windows version is one Microsoft still supports.
7. The firewall itself is on
Get-NetFirewallProfile | Select-Object Name, Enabled
Good: True three times. See why not to switch it off.
8. Nobody is guessing at this moment
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625} -MaxEvents 1000 -ErrorAction SilentlyContinue | Group-Object {$_.Properties[19].Value} | Sort-Object Count -Descending | Select-Object -First 10 Count, Name
This counts recent failed logins by source address. Good: a short list with your own typing mistakes. Hundreds from foreign addresses mean the port is open to the world and being tried; go back to check 5.
9. You know who logged in
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-TerminalServices-LocalSessionManager/Operational'; Id=21} -MaxEvents 20 | Select-Object TimeCreated, Message | Format-List
Each entry is a successful Remote Desktop logon with user and source address. Good: nothing you cannot explain.
10. Idle and disconnected sessions end
quser
Get-ItemProperty 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -ErrorAction SilentlyContinue | Select-Object MaxDisconnectionTime, MaxIdleTime
quser lists sessions and how long each has been idle. Good: no administrator session left disconnected for days. Time limits are set in Group Policy under Remote Desktop Session Host, Session Time Limits. Take care if you rely on programs that keep running in a disconnected session; a limit would end them.
Score sheet
| # | Practice | Pass looks like |
|---|---|---|
| 1 | Network Level Authentication | 1 |
| 2 | Account lockout | A threshold, not "Never" |
| 3 | Limited remote users | Only known names |
| 4 | No stale accounts | Guest off, nothing unused |
| 5 | Restricted port | Not Any |
| 6 | Updates | This or last month |
| 7 | Firewall on | Three times True |
| 8 | Failed logins | Few, and explained |
| 9 | Successful logins | All explained |
| 10 | Session limits | No forgotten sessions |
Three things no command can check
- The password itself: long, random, used nowhere else.
- Backups: a copy off the server that you have restored at least once. See Windows Server Backup.
- Your own PC: ten habits for users.
Run the list again every few months, and after any change of staff. For a team, add the process side: a secure private RDP for your business. Servers where these settings are in your hands: Windows VPS.
Questions
What are the best practices for RDP security?
Network Level Authentication, account lockout, few remote users, no stale accounts, a restricted port, monthly updates, the firewall on, and regular checks of the login records.
How do I check if NLA is enabled?
Read the value UserAuthentication under the RDP-Tcp registry key; 1 means on.
How do I see failed RDP login attempts?
Look for event 4625 in the Security log with Event Viewer or Get-WinEvent.
How do I see who logged in through RDP?
Event 21 in the log TerminalServices-LocalSessionManager/Operational records each Remote Desktop logon with user and source address.