A fresh Windows VPS reaches you in whatever state the provider’s template left it. That usually means a default Administrator account, remote desktop reachable from the public internet, Windows Update unconfigured, and the firewall profile open enough to get you logged in. The first thirty minutes should convert that blank slate into an instrumented, restricted host you can leave running unattended. Everything below is command-line work you can repeat on the next server without thinking about it.
Write each step down or keep the commands in a script file on the guest itself. A hardening pass you cannot repeat is not hardening, it is a one-time favour to this particular machine. If you are comparing plans for a new box, the main site covers the baseline specs worth having before you start tightening anything.
1. Confirm the Image and Record Build Information
Before changing a single setting, capture what you were given. Edition, build number, and the installed roles decide which hardening options actually exist on this host.
Get-ComputerInfo | Select WindowsProductName, WindowsVersion, OsBuildNumber, CsTotalPhysicalMemoryGet-WindowsFeature | Where-Object Installed | Select NameGet-CimInstance Win32_OperatingSystem | Select Caption, InstallDate, LastBootUpTimesysteminfo | findstr /C:"OS Version" /C:"System Boot Time"
Save the output to a text file inside C:\Admin\ and later copy it off the host. When a provider rebuilds your VM from the same template six months from now, this file tells you which build you started from and which baseline assumptions were true at that moment.
2. Patch Before Anything Else
An untouched template is often months behind on cumulative updates. Install them before you expose the box to more traffic, and keep the server awake so the install does not stall mid-run.
Install-PackageProvider -Name NuGet -Force Install-Module PSWindowsUpdate -Force -Confirm:$false Get-WindowsUpdate -Install -AcceptAll -IgnoreReboot
When the installer requests a restart, reboot manually rather than letting the update engine pick a time. Check the next boot with Get-HotFix | Sort InstalledOn -Descending | Select -First 5 and confirm the newest cumulative patch is present.
Set a maintenance window in your provider’s console if one exists, and record the reboot policy. A server that reboots without warning at 03:00 is not a secured server, it is a surprise waiting for whoever is on call.
3. Rename the Administrator and Add a Named Account
The built-in Administrator account is the first account every automated RDP scanner tries. Rename it, disable it, or both, and create a named account with a strong password that belongs only to you.
Rename-LocalUser -Name Administrator -NewName svc_localadminNew-LocalUser -Name deploy -Password (Read-Host -AsSecureString) -FullName "Deploy Admin"Add-LocalGroupMember -Group Administrators -Member deploy
Keep the renamed account disabled and use the named one for interactive login. If a password manager or vault is available, store credentials there and revoke them on staff changes instead of passing them around in chat.
Audit local group membership right after: Get-LocalGroupMember -Group Administrators. Any account you did not create is either part of the template’s tooling or something you need to remove now, and it is far easier to identify that on day one than after an incident.
4. Configure Windows Firewall for RDP Access
Do not leave RDP open to every address on the internet. Restrict the port to your office or VPN egress ranges, and confirm the rule change with a test connection from a second machine before you log out.
| Setting | Recommended value | Check |
|---|---|---|
| Remote Desktop rule scope | Your static IP /24 only | Get-NetFirewallRule -DisplayGroup "Remote Desktop" |
| Public profile inbound | Block all except RDP | Get-NetFirewallProfile -Name Public |
| Private profile | Block inbound by default | Set-NetFirewallProfile -Name Private -DefaultInboundAction Block |
| Network Level Authentication | Required | Registry below |
Enable Network Level Authentication so unauthenticated sessions never reach the logon screen:
Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name UserAuthentication -Value 1 Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name SecurityLayer -Value 2
If changing the RDP port, edit PortNumber on the same key, add a matching firewall rule, and update the provider’s console or NAT rule too. A port change that only exists inside Windows will lock you out at the network edge.
5. Establish the Update and Restart Policy
Unmanaged patching is how most compromised servers get their foothold. Decide on a single policy: Windows Update handling quality patches automatically, deferrals for feature updates, and a fixed reboot window you control.
Set-ItemProperty 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name NoAutoRebootWithLoggedOnUsers -Value 1 Set-ItemProperty 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name AUOptions -Value 4 Set-ItemProperty 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' -Name ScheduledInstallTime -Value 3
Then confirm the Windows Update service is not disabled and that the reboot is actually you, not a background installer. For hosts running IIS or SQL, use Get-Service wuauserv to verify the service state and check the pending reboot flag at HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending.
6. Set Up Logging and Remove Default Services
Turn on the logging you will actually read: failed logons, account creation, and service installs. Then remove the roles and applications the template shipped that you never asked for.
auditpol /set /category:"Logon/Logoff" /success:enable /failure:enableauditpol /set /category:"Account Management" /success:enable /failure:enableGet-WindowsFeature | Where-Object Installed | Where-Object Name -Match 'Telnet|FTP|SMB1'Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol -NoRestart
Set the Security log to a larger size so a week of failed logon noise fits: wevtutil sl Security /ms:268435456. Then open Event Viewer and confirm the filter you plan to check shows real entries, not an empty view.
Any local account that exists only because a template author needed it for deployment should be removed. Fewer accounts means fewer passwords to rotate and fewer paths for lateral movement.
7. Take a Baseline Snapshot and Test Recovery
Once the hard work is done, capture a provider-level snapshot and store a local configuration export. The snapshot is your rollback point; the export is your documentation.
Get-NetFirewallRule | Export-Clixml C:\Admin\firewall_baseline.xmlGet-LocalUser | Select Name, Enabled, LastLogon | Export-Csv C:\Admin\users.csvGet-WindowsFeature | Where-Object Installed | Export-Csv C:\Admin\features.csv
Then prove the recovery works: reboot, connect over RDP from outside the allowlist to confirm the firewall rejects you, connect from an allowed address to confirm you can still get in. A backup you have never restored from is a hope, not a plan. Snapshot the VM through the provider panel once those two tests pass.
Keep the exported files somewhere off the host too. If the disk image is what fails, the configuration exports living on that disk fail with it. For the next step after this checklist, look at how you will run daily operations — the contact page links to the admin write-ups that follow on from here.



