KB
Windows Server

Manage RDS Grace Period Key in Windows Server

4 min read886 words11 code blocks

At a glance#

  • Purpose: Locate, take ownership of, back up and inspect the Remote Desktop Services GracePeriod registry 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:

powershell
$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:

powershell
Get-WmiObject -Namespace "root\CIMV2\TerminalServices" `
  -Class Win32_TerminalServiceSetting | Select-Object LicensingName, LicensingType

A misconfigured or unreachable licensing server is the usual root cause, and fixing that is the correct resolution.

3. Open Registry Editor#

  1. Press Win + R, type regedit.exe, press Enter.
  2. Accept the UAC prompt.

4. Navigate to the key#

text
HKEY_LOCAL_MACHINE
  └ SYSTEM
      └ CurrentControlSet
          └ Control
              └ Terminal Server
                  └ RCM
                      └ GracePeriod

The key appears greyed out or inaccessible — expected, and the reason for the next step.

5. Take ownership#

  1. Right-click GracePeriodPermissions…
  2. Click Advanced.
  3. Next to Owner, click Change.
  4. Type Administrators, click Check Names, then OK.
  5. Tick Replace owner on subcontainers and objects.
  6. Click Apply, then OK.

6. Grant Administrators full control#

  1. Back in the Permissions dialog, select the Administrators group.
  2. Tick Full Control in the Allow column.
  3. Click Apply, then OK.

7. Export the key before any change#

Never skip this. It is the only straightforward way back.

  1. Right-click GracePeriodExport.
  2. Save as GracePeriod-backup-YYYY-MM-DD.reg somewhere off the server.

You can also do it from PowerShell:

powershell
reg export "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod" `
  C:\Backup\GracePeriod-backup.reg

8. Inspect the contents#

powershell
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#

powershell
Restart-Computer -Force

Changes to this key are not picked up until the Remote Desktop services restart.

Verification#

After the reboot, from an elevated PowerShell prompt:

powershell
$rds = Get-WmiObject -Namespace "root\CIMV2\TerminalServices" `
       -Class Win32_TerminalServiceSetting
$rds.GetGracePeriodDays()

Confirm RDP connections are working:

powershell
qwinsta

Check the event log for licensing warnings:

powershell
Get-EventLog -LogName System -Source "Microsoft-Windows-TerminalServices*" -Newest 20

Restoring from backup#

If something goes wrong:

powershell
reg import C:\Backup\GracePeriod-backup.reg
Restart-Computer -Force

If 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:

  1. Purchase RDS CALs — per-user or per-device.
  2. Install the Remote Desktop Licensing role on a server.
  3. Activate the licensing server against Microsoft.
  4. Install the CALs on it.
  5. Point the session host at it:
powershell
$obj = Get-WmiObject -Namespace "root\CIMV2\TerminalServices" `
       -Class Win32_TerminalServiceSetting
$obj.SetSpecifiedLicenseServerList("licensing-server.domain.local")
$obj.ChangeMode(4)   # 4 = Per User, 2 = Per Device

Once that is in place the grace period stops being relevant.

Troubleshooting#

SymptomCause and fix
Cannot take ownership even as AdministratorUse PsExec -s -i regedit.exe from Sysinternals to run Registry Editor as SYSTEM.
Key does not existThe RD Session Host role is not installed, so there is no grace period.
"No Remote Desktop License Servers available" persistsLicensing server unreachable or has no CALs. Check with Get-EventLog and confirm DNS resolution.
Server will not boot after registry changeRestore the snapshot, or boot to Last Known Good Configuration.
GetGracePeriodDays returns an errorThe WMI class is missing because the role is not installed.