Renew the RDP Server Grace Period

wiseregistrycleaner-icon.pngDoes your MS Windows RDP (Remote Desktop Protocol) Server keep complaining about its expiring RDP license, even though you already have a license? Let’s look at how we can remedy this known issue, especially with MS Windows 2012 R2 RDP Server… Every now and then, and to be precise, every 120 days, I get a call from one of my friends, who is running a very successful business, telling me that his MS Windows RDP 2012 R2 Server has stopped accepting RDP connections. We apply a license key to the server, one we purchased from one of the Microsoft resellers, and the same issue will repeat itself.

A search through the internet reveals that I am not the only one experiencing this issue, and that it is related to MS Windows 2012 R2. The issue appears to arise specifically when you also don’t have a Domain Controller (DC) installed.

To remedy this issue for my friend, and to keep his business running, I RDP into the MS Windows 2012 R2 Server with the Admin rights. I then delete the GracePeriod registry key.  The next step is to restart the Terminal Server service.

The registry key to be deleted can be found at:

“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod”

To delete this registry key, you must change the ownership, as follows:

Right-Click–>Permissions–>Advanced–>Owner, Select Administrators, Apply.

This is a great temporary solution if you have to perform it once; but what if it keeps repeating itself? You have to run through this manual procedure every 120 days. Well, we have a solution; read on.

I wrote a short script, using the following commands, that will run the steps to achieve the same outcome. I then saved them into a “.cmd” file, and then set the MS Windows Scheduler to run the .cmd file every 119 days.

The commands to go into the .cmd script are:

setacl -on “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod” -ot reg -actn setowner -ownr “n:administrators”

subinacl /keyreg “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod” /setowner=administrator /grant=administrators=f

reg delete  “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod” /f

net stop TermService /y && net start TermService


With these quick steps, I offloaded this task to the MS Windows Scheduler. This keeps my friend happy and his business operating as he likes it. Obviously, I’m planning to migrate the workload to another cloud provider where I can upgrade the OS to MS Windows 2016, and will make sure the MS Windows RDP Server is deployed correctly.

In this blog post, I introduced and used two commands; the “setacl” and the “subinacl“. You can download those by clicking on the hyperlinked commands  to open the comment boxes, and then clicking on the blue hyperlinks in the boxes to open their web pages.

Leave a Reply