Reset license Remote Desktop

Sollten Sie auch schon einmal mit der RDS-Lizenzierung eines Terminalservers gekämpft haben, so finden Sie hier ein paar nützliche Tipps zur Diagnose.

When you home lab and you don't have Microsoft license for RDS, you have two options. Reinstall the server [redeploy the VM] or cheat a bit. Yes, in fact, there is cool hack which allows you to reset the 120 day grace period on Windows Server 2012 R2 RDS, and we'll show you how. I like doing posts which shows some cool hacks, and this is exactly this kind of post – How To Reset 120 Day RDS Grace Period on 2012 R2 Server.

Normally you would need to activate the RDS/TS CAL License server and point the Server to License server with User/Device License and will resolve the problem. However, we don't want to do that because we have no license from Microsoft, in our lab. [and many other IT pros who test stuff in the lab too].

What we will do is simply reset the default timer which is 120 days grace time, when you first add the RDS role. In fact, you do not need to reboot the server either. Simply log out and back in and the message changes from let's say 54 days left to 120 days left. And that's it.

Note: This tip works also on Windows Server 2016

For every admin who runs homelab or has a cloud lab, this is a must known hack.

Obviously, you won't do this in a production environment, because your production environment is covered with a proper license. Right? Ok, this is clearly for labs, tests, cloud tests etc…

How To Reset 120 Day Grace Period on 2012 R2 Server RDS – The Steps

Step 1: Connect to your RDS Server as an admin and open regedit.

Navigate to the following key:

The solution is to delete the REG_BINARY in:

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

It's called a “TimeBomb” … -:]

Note: You must first take an ownership and give admins the full rights.

Like this:

*********************************************************************

DC Scope for VMware vSphere – optimization, capacity planning, and cost management. Download FREE Trial Here.

  • Tracks the performance of VMs with a summary view of the resources and metrics in degradation.
  • Easily improve the performance of your infrastructure.
  • DC Scope is affordably priced per VM.

*********************************************************************

Go to menu Edit > Permissions

Once you delete the Registry key you must reboot the host. Some users have reported that when not rebooting the host you will see the message changing, but no connections are possible.

Update: Well, in fact, you can just restart the Service “Remote Desktop Services” which will momentarily disconnect all the active sessions and then after a minute or so you can reconnect to the sessions.

You should see the message changing at the taskbar area….

Note that you have also a possibility to check how many days its left… Go to the command prompt and enter this command [not tested].

wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TerminalServiceSetting WHERE [__CLASS !=””] CALL GetGracePeriodDays

Apparently, you can delete this key every time it expires ….. indefinitely. Wow. That's good to know too.

This is it my friends. Today's tip for home labs.

Second Tip:

Update: The Microsoft's script was taken down. I have been contacted by someone [look at the comments section] who has published an alternative. Get it here.

Download a PowerShell script from Microsoft allowing you to reset the RDS grace period.

Quote from Microsoft Technet:

The PowerShell script can be used to query and reset terminal server grace period to default 120 days if it is nearing to the end. We often need to deploy Terminal Server [Remote Desktop Session Host in 2012] for testing purposes in development environments allowing more than 2 concurrent Remote Desktop Sessions on it. When it is installed, by default if no RDS or TS Licensing server is specified via either GPO or Registry, it is in default Grace period which is 120 days and it works fine until then.

Once Grace period expires, the server does not allow even a single Remote Desktop session via RDP and all we are left with is to logon to the Console of machine using Physical/Virtual console depending on Physical or Virtual machines or try to get in using mstsc /admin or mstsc /console, then remove the role completely and restart the terminal server [RDS Server] and post that it starts accepting default two RDP sessions.

In the comment section, there was a user who affirmed that he verified it on Windows Server 2016 as well and it works just fine. With that, stay tuned for more.

More from ESX Virtualization:

Subscribe to RSS, and social media channels [Twitter, FB, YouTube]

Steps to reset 120 Days RDS Grace Period

  1. Open "Regedit" and go to HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod
  2. Right Click and go to Permission – Advanced – Owner. Change the ownership from Network Service to Administrator Account
  3. Assign Full Control permission to Administrator
  4. Delete the item highlighted in RED

  1. Reboot the server or restart the Terminal Service
Restart-Service TermService -force
  1. The Grace period of RDS server should be reset to default 120 Days now.
[Invoke-WmiMethod -PATH [gwmi -namespace root\cimv2\terminalservices -class win32_terminalservic esetting].__PATH -name GetGracePeriodDays].daysleft 119

  • Article
  • 09/24/2021
  • 2 minutes to read

This article describes how to remove Terminal Server licenses from a Remote Desktop Protocol [RDP] client.

Applies to:   Windows 10 - all editions, Windows Server 2012 R2
Original KB number:   187614

When an unlicensed client connects to a Terminal Server for the first time, the Terminal Server issues the client a temporary Terminal Server Client Access License [CAL] token. After the user has logged into the session, the Terminal Server instructs the License Server to mark the issued temporary Terminal Server CAL token as being validated. The next time the client connects, an attempt is made to upgrade the validated temporary Terminal Server CAL token to a full Terminal Server CAL token. If no license tokens are available, the temporary Terminal Server CAL token will continue to function for 90 days. The license is stored in the client's registry.

32-bit RDP clients store their license under the key HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing.

Important

This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, see How to back up and restore the registry in Windows.

Clean RDP client's license cache

To clean the client's license cache, just delete this key and its subkeys. The next time the client connects to the server, it will obtain another license.

For 16-bit RDP clients, run regedit /v. Then delete the keys under \Software\Microsoft\MSLicensing to clean the client's license cache. You can also delete the BIN files from \Windows\System\Regdata.

The RDP client for Macintosh stores the license in a file on the local computer in the folder hierarchy under /users/Shared/Microsoft/RDC Crucial Server Information/. To clean the Macintosh client's license cache, delete the contents of this folder. The client will try to obtain a new license from the server the next time that it connects.

If you delete the HKEY_LOCAL_MACHINE\Software\Microsoft\MSLicensing subkey on a client that is running Windows Vista or a later version, later attempts to connect to a Terminal Server may fail. Also, you receive the following error message:

An Error occurred in the Licensing Protocol

To resolve this problem, right-click the Remote Desktop Connection shortcut, and then select Run as Administrator. By default, the remote desktop connection runs as a user with the lowest user permissions. By default, a restricted user doesn't have permission to write registry entries to HKEY_LOCAL_MACHINE. Therefore, attempts to rewrite the MSLicensing key fail. Starting Remote Desktop Connection with administrative credentials provides the permissions that are necessary to write the needed registry keys.

Did this fix the problem

Check whether the problem is fixed. If the problem isn't fixed, contact support.

Video liên quan

Chủ Đề