Manage RDS Grace Period Key in Windows Server
At a glance#
- Purpose: Locate, take ownership of, back up and inspect the Remote Desktop Services
GracePeriodregistry key. - Applies to: Windows Server 2012 R2, 2016, 2019 and 2022.
- Risk: High — registry ownership changes and a reboot; incorrect edits can prevent RDS from starting.
- Time: About 20 minutes plus reboot.
Overview#
When the Remote Desktop Session Host role is installed, Windows begins a 120-day licensing grace period. During that window RDS accepts connections without a licensing server. When it expires, connections are refused with "No Remote Desktop License Servers available".
The countdown is stored in a protected registry key that even Administrators cannot read by default. Ownership has to be taken before it can be inspected or exported.
Important — licensing. Clearing this key resets the countdown, and that is widely circulated online as a way to keep using RDS indefinitely. It is not a licensing solution. Running production Remote Desktop Services without RDS CALs breaches the Microsoft licensing agreement and will be picked up in any audit. The legitimate reasons to touch this key are: confirming how many days remain, exporting it for a support case, or clearing a grace period that remains stuck after a licensing server has been correctly configured. If the grace period is simply running out, the answer is to buy CALs and stand up a licensing server — not to reset the counter.
Before you start#
- Local Administrator rights on the server.
- A maintenance window — a reboot is required and all RDP sessions drop.
- A VM snapshot or full system backup.
- Confirmation of the licensing position with whoever owns it.
Warning: Incorrect registry edits can leave a server unbootable. Export any key before you change it, and take the snapshot first.
Procedure#
1. Check the remaining grace period first#
Before changing anything, find out what the actual position is. From an elevated PowerShell prompt:
$rds = Get-WmiObject -Namespace "root\CIMV2\TerminalServices" `
-Class Win32_TerminalServiceSetting
$rds.GetGracePeriodDays()The returned DaysLeft value tells you whether this is urgent, and often makes the rest of the procedure unnecessary.
2. Confirm the licensing configuration#
If the grace period is expiring, check whether a licensing server is configured at all:
Get-WmiObject -Namespace "root\CIMV2\TerminalServices" `
-Class Win32_TerminalServiceSetting | Select-Object LicensingName, LicensingTypeA misconfigured or unreachable licensing server is the usual root cause, and fixing that is the correct resolution.
3. Open Registry Editor#
- Press Win + R, type
regedit.exe, press Enter. - Accept the UAC prompt.
4. Navigate to the key#
HKEY_LOCAL_MACHINE
└ SYSTEM
└ CurrentControlSet
└ Control
└ Terminal Server
└ RCM
└ GracePeriodThe key appears greyed out or inaccessible — expected, and the reason for the next step.
5. Take ownership#
- Right-click GracePeriod → Permissions…
- Click Advanced.
- Next to Owner, click Change.
- Type
Administrators, click Check Names, then OK. - Tick Replace owner on subcontainers and objects.
- Click Apply, then OK.
6. Grant Administrators full control#
- Back in the Permissions dialog, select the Administrators group.
- Tick Full Control in the Allow column.
- Click Apply, then OK.
7. Export the key before any change#
Never skip this. It is the only straightforward way back.
- Right-click GracePeriod → Export.
- Save as
GracePeriod-backup-YYYY-MM-DD.regsomewhere off the server.
You can also do it from PowerShell:
reg export "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod" `
C:\Backup\GracePeriod-backup.reg8. Inspect the contents#
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod"The value is a binary timestamp and is not human-readable. Use the WMI query in step 1 to see remaining days.
9. Restart the server#
Restart-Computer -ForceChanges to this key are not picked up until the Remote Desktop services restart.
Verification#
After the reboot, from an elevated PowerShell prompt:
$rds = Get-WmiObject -Namespace "root\CIMV2\TerminalServices" `
-Class Win32_TerminalServiceSetting
$rds.GetGracePeriodDays()Confirm RDP connections are working:
qwinstaCheck the event log for licensing warnings:
Get-EventLog -LogName System -Source "Microsoft-Windows-TerminalServices*" -Newest 20Restoring from backup#
If something goes wrong:
reg import C:\Backup\GracePeriod-backup.reg
Restart-Computer -ForceIf the server will not boot, restore the VM snapshot.
The correct long-term fix#
Where the grace period is genuinely expiring, the supported path is:
- Purchase RDS CALs — per-user or per-device.
- Install the Remote Desktop Licensing role on a server.
- Activate the licensing server against Microsoft.
- Install the CALs on it.
- Point the session host at it:
$obj = Get-WmiObject -Namespace "root\CIMV2\TerminalServices" `
-Class Win32_TerminalServiceSetting
$obj.SetSpecifiedLicenseServerList("licensing-server.domain.local")
$obj.ChangeMode(4) # 4 = Per User, 2 = Per DeviceOnce that is in place the grace period stops being relevant.
Troubleshooting#
| Symptom | Cause and fix |
|---|---|
| Cannot take ownership even as Administrator | Use PsExec -s -i regedit.exe from Sysinternals to run Registry Editor as SYSTEM. |
| Key does not exist | The RD Session Host role is not installed, so there is no grace period. |
| "No Remote Desktop License Servers available" persists | Licensing server unreachable or has no CALs. Check with Get-EventLog and confirm DNS resolution. |
| Server will not boot after registry change | Restore the snapshot, or boot to Last Known Good Configuration. |
GetGracePeriodDays returns an error | The WMI class is missing because the role is not installed. |