Сброс триального периода rdp windows server 2019

После завершения активации сервера лицензирования, который включен в ОС Microsoft, и установки лицензий выдается льготный период лицензирования продолжительностью 120 дней. По истечении данного срока достаточно заново активировать сервер лицензирования, чтобы сбросить счетчик дней и продолжить использование терминального сервера.

В данной статье мы рассмотрим способ сброса данного льготного периода.

1. Переходим в редактор реестра. Для этого нажимаем сочетание клавиш WIN+R и вводим regedit. В редакторе реестра открываем раздел:

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

Сброс льготного периода терминального сервера Windows

2. После этого нажимаем правой кнопкой мыши на раздел GracePeriod и переходим в Разрешения

Сброс льготного периода терминального сервера Windows

3. В появившемся окне нажимаем Дополнительно

4. Далее нам потребуется сменить владельца раздела и разрешить ему полный доступ. Для смены владельца нажмите на Изменить в поле Владелец.

Сброс льготного периода терминального сервера Windows

5. В качестве владельца раздела установим группу Администраторы. Нажав кнопку Проверить имена можно сделать проверку наличия этой группы — если она существует, то имя группы станет подчеркнутым. Нажимаем ОК для сохранения изменений.

Сброс льготного периода терминального сервера Windows

6. Для выхода из дополнительных параметров безопасности еще раз нажимаем ОК, чтобы сохранить внесенные изменения. Затем в окне разрешений выбираем группу Администраторы и ставим галочку для разрешения полного доступа. Также нажимаем ОК и возвращаемся в открытый раздел в редакторе реестра.

7. Теперь в редакторе реестра нам необходимо удалить параметр L$RTMTIMEBOMB_<…>. Для этого нажимаем на него правой кнопкой мыши и выбираем Удалить. Если на предыдущих шагах вы корректно сменили владельца и назначили права, то удаление произойдет без проблем.

Сброс льготного периода терминального сервера Windows

8.Закрываем редактор реестра и перезагружаем сервер для применения изменений.

9. Для проверки того, что льготный период сбросился, вы можете воспользоваться командной строкой. Для этого нажмите сочетание клавиш WIN+R, введите cmd, после этого в открывшемся окне выполните команду:
wmic /namespace:\\root\CIMV2\TerminalServices PATH Win32_TerminalServiceSetting WHERE (__CLASS !=»») CALL GetGracePeriodDays

Сброс льготного периода терминального сервера Windows

If you have a home lab environment or another lab where you continually test various solutions, licensing, and trial expiration is a challenge that you constantly tend to run into. It is just part of the fun of lab environments. While most trials are fairly “hard and fast” and don’t allow you to reset the trial expiration, if you work with Microsoft Windows Server and Remote Desktop Services (RDS), there is a “hack” that allows you to effectively reset the expiration of Remote Desktop Services grace period where you can essentially rewind the clock on your RDS licensing if you are making use of this role inside your lab environment. I am using Windows Server 2019 for my Windows workloads in my lab environment. In this post, I will show how to reset 120 day RDS licensing Grace period on 2016 and 2019 Windows Server. Let’s see.

Remote Desktop Services RDS Licensing

When you install Windows Server 2016 or 2019 as with previous Windows versions, you get the normal ability to have the two sessions you generally have available for administering.

However, when you install the true Remote Desktop Services role, you can have multiple sessions on your server. This is similar to the legacy Terminal Server role in previous versions of windows.

Production vs testing purposes

Typically in a production environment, you will have remote desktop license servers that house the client access licenses and then you will have multiple session host server instances configured for hosting user sessions.

When you install the role, by default, you have a 120-day grace period that Microsoft gives you to license the server for use as an RDS installation properly. This is accomplished by configuring remote desktop license servers with client access licenses. If you are using a server in a lab environment, most likely, you are not going to license this type of server outside of production in a testing environment, using a license server with a remote desktop session host.

RDS grace period error message

Once the 120 day grace period has expired, you will see the following error when you attempt to RDP to the server, referring to the licensing server needed for the proper license past the grace period. Windows will deactivate the ability to connect using Remote Desktop Services.

Error-after-120-day-grace-period-has-expired-for-Remote-Desktop-Services

Error after 120 day grace period has expired for Remote Desktop Services

You can either redeploy your Windows Server which will allow you to spin up a new 120 day grace period, or you can actually reset the grace period. If you are like me, the latter is certainly the path of least resistance and work involved. Let’s take a look at how to reset the 120 day RDS grace period.

You can take a closer look at the official licensing documentation for Remote Desktop Services here:

  • https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/rds-client-access-license

For resetting the 120 day grace period for the RDS role, the registry editor is your friend and makes this process easy. Before we begin, there are a couple of disclaimers to make here. Editing the registry can result in totally destroying a Windows system, so proceed with any low-level registry edits with caution. Creating a quick snapshot of the Windows virtual machine before you begin is always a good practice if you are working with a virtual machine.

Important Considerations:

  1. Run as Administrator: This script needs to be run with Administrator privileges due to the modifications it makes to the system registry and service control.
  2. Backup: It’s highly recommended to backup the registry before running this script, as deleting registry keys can affect system functionality.
  3. Testing: Test the script in a non-production environment first to ensure it behaves as expected.
  4. Legal and Compliance: Resetting the RDS grace period is intended for testing and evaluation purposes. Ensure compliance with Microsoft licensing agreements and terms of service when using this script.

Overview of resetting the grace period

Additionally, for production systems, resetting the 120 day grace period should only be done for systems that are not in production, as you should have proper licensing installed for production use.

To reset the grace period, there are actually just 3 steps involved:

  1. Change permissions on the RCM > GracePeriod key
  2. Delete the “Timebomb” registry entry
  3. Reboot the server

Now that we have level-set, once you have your snapshot or other backup created, you need to navigate to the following key location on your RDS server:

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

We will manipulate the registry to extend or renew the RDS grace period back to the 120-day period. 

Change Permissions on the RDS GracePeriod key and delete the key

Open a command prompt, and type regedit. After you have navigated to the key documented above, right-click GracePeriod and select Permissions.

Navigate-to-the-RDS-GracePeriod-key

Navigate to the RDS GracePeriod key

For obvious reasons, there are no default permissions on this key for even Administrators. So you have to first take ownership of the key before you can delete the timebomb value. Click the Advanced button on the permissions dialog box.

Navigate-to-the-Advanced-permissions-properties

Navigate to the Advanced permissions properties

Click the Change button next to the Owner.

Change-the-ownership-of-the-registry-key

Change the ownership of the registry key

Here I have selected local administrators group as the owner of the key. However, you will want to choose whichever user/group you want to use to delete the registry key. Select the options to replace owners and replace all child object permissions.

User-for-ownership-selected-and-set-to-replace-permissions-on-child-objects

User for ownership selected and set to replace permissions on child objects

Confirm the replacement of permissions on the registry key.

Confirm-replacing-permissions

Confirm replacing permissions

Now that we have changed ownership on the key, we can actually set permissions without getting permissions errors. Here I am granting administrators full control on the key.

Change permissions for the user you want to be able to delete the key

Now, with permissions set, right-click the timebomb value in the GracePeriod key and Delete.

Delete-the-timebomb-key

Delete the timebomb key

Confirm the deletion of the registry entry.

Confirm-deletion-of-the-timebomb-key-in-the-registry

Confirm deletion of the timebomb key in the registry

Next, the only thing left to do is reboot your server. Once the server is rebooted, you can enjoy once again having the full 120 day grace period for your RDS server in the lab environment.

Reset 120-day grace period using PowerShell

Now that we have seen how to do this manually, let’s see how we can do this using PowerShell. Make sure to back up your registry before running any type of script that manipulates registry settings.

# Define the path to the RDS grace period registry key
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod"

# Check if the registry key exists
if (Test-Path $registryPath) {
    try {
        # Take ownership of the registry key
        takeown /f $registryPath /r /d y
        # Assign full control permissions to the Administrators group
        $acl = Get-Acl $registryPath
        $permission = "Administrators","FullControl","ContainerInherit,ObjectInherit","None","Allow"
        $accessRule = New-Object System.Security.AccessControl.RegistryAccessRule $permission
        $acl.SetAccessRule($accessRule)
        Set-Acl $registryPath $acl

        # Remove the registry key
        Remove-Item -Path $registryPath -Recurse
        Write-Host "The RDS Grace Period registry key has been successfully removed."
    } catch {
        Write-Error "An error occurred while removing the RDS Grace Period registry key: $_"
    }
} else {
    Write-Host "The RDS Grace Period registry key does not exist. No action is necessary."
}

# Restart the Remote Desktop Licensing service
try {
    Restart-Service TermService -Force
    Write-Host "The Remote Desktop Services have been restarted successfully."
} catch {
    Write-Error "An error occurred while restarting the Remote Desktop Services: $_"
}

Wrapping up

The process to reset 120 day RDS Grace period on 2016 and 2019 Windows Servers as well as older server versions such as Windows Server 2012 and 2012 R2 is very straightforward using this process to delete the timebomb registry key.

Keep in mind this is not supported and certainly not a process for running in production. However, it is very handy for lab environments to keep from having to redeploy Windows Server virtual machines to have a fresh 120 day grace period.

For those who regularly connect to office or site networks through Remote Desktop, remote connectivity problems are nothing new. Some of these problems are simply caused by network glitches, network misconfigurations, or system problems.  If you work with Microsoft Windows Server and Remote Desktop Services (RDS), You may encounter the following error message when trying to connect to a Windows Server Remote Desktop Session Host (RDSH) server:

The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license.
Please contact the server administrator.

The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license.

The remote session was disconnected

What is Remote Desktop Services RDS Licensing

When you install Windows Server 2016 or 2019 alongside previous versions of Windows, you get the usual ability to have two sessions that you would normally have available for management. However, when you install the appropriate Remote Desktop Services role, you have the option of having multiple sessions on your server.

By default, when you install the RDS role, you have a 120-day grace period provided by Microsoft to properly license the server you use as your RDS installation. Once the 120-day grace period has expired, you will see The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license. Please contact the server administrator error when you attempt to RDP to the server.

In this case, the client’s computer may try to connect to the RDSH server using an expired temporary RDP license (if the RDS license server was not available when the client first connected, the customer has a temporary RDP license for 120 days. ). In this case, You can either redeploy your Windows server, which will allow you to start a new grace period of 120 days or you must reset this expired license in the registry of RDS Server.

Also Read : –

  1. How to Fix Error Code 0x80004005 Unspecified in Windows 10/11
  2. How to fix error 0x00000bc4, No printers were found in Windows 11

If Remote Desktop Licensing Diagnostics reports correct license information and does not find any errors or problems, the problems may be due to an apparent bug in Windows Server where the RDSH server fails to contact the license server after the grace period has expired of the 120 day license. Before starting, a few caveats. Registry editing can completely destroy your Windows system, so be careful with low-level registry editing and make sure to take a registry backup.

Please follow the below steps to reset the RDS Grace Period.

Apply the instructions below, only if you’re using the RDS Server 2012. 2016, 2019 on a testing environment. I will talk about the remote connection problem caused by the RDS license. Remote Desktop licenses are also known as client access licenses (CALS). This license can be purchased from Microsoft and configured on servers with connectivity issues.

  • Press the Windows Key then press “R“.
  • Type “regedit” in the run box and hit “OK“.
  • Navigate to the following location.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\GracePeriod
  •  Right-click at the ‘GracePeriod’ key and select Permissions.

There is no default permission for this key, not even for administrators. Before you can remove the time constraint value, you must first take ownership of the key. Click the Advanced button in the Permissions dialog box.

Reset 120 day RDS Grace period using Registry on Windows Server

Click the Change button next to the Owner.

Reset 120 day RDS Grace period using Registry on Windows Server-2

Here, we have selected the local administrator’s group as the main owner. However, you must select the user/group to use to delete the registry key. Select options to override owners and override all child object permissions.

Reset 120 day RDS Grace period using Registry on Windows Server-3

Confirm the replacement of permissions on the registry key GracePeriod.

Confirm replacing permissions GracePeriod

Now that we’ve changed the ownership of the key, we can actually set permissions without getting permission errors. Here I give administrators full control over the GracePeriod Key.

Now, with permissions set, right-click the timebomb value in the GracePeriod key and Delete. Or you can Delete GracePeriod Key From the RCM.

Reset GracePeriod RDS

Confirm the deletion of the registry entry.

Delete-GracePeriod

Then all you have to do is restart your server. After restarting the server, you can enjoy the full 120 day grace period of your RDS server in the lab environment again.

Restart Server for-Reset RDS GracePeriod

Video Overview of the Process

Windows Server

In this blog post I will show you how to extend your trial period to three years. The evaluation version of Windows Server 2016 / 2022 is valid for 180 days and you can convert your trial version to retail.

After installing, you can try it out for 180 days. After 180 days you and your system will run into troubles for sure. But the good news is: You can extend the period to another 180 days up to 3 years.

Extending the Trial Period

First, take a look at your desktop. You should see the countdown in the corner down right.

Unbenannt.PNG

Or start PowerShell and run slmgr.

slmgr -dlv

Pay attention to the Timebased activation expiration and the Remaining Windows rearm count. You can rearm the period 6 times. (180 days * 6 = 3 years).

Unbenannt.PNG

When the period comes to an end, run slmgr -rearm to extend it by another 180 days.

slmgr -rearm

Unbenannt.PNG

Next restart your computer.

Restart-Computer

Once restarted, open PowerShell and check your settings.

slmgr -dli

Unbenannt.PNG

Important Note

The evaluation version may not be used for commercial purposes. Have fun playing with the Windows Server 2016 Evaluation Version!

By the way: You can do the same with Windows 10711. But the Windows 10/11 Evaluation Version can be used only for 180 days in total.

Published by Patrick Gruenauer

Microsoft MVP on PowerShell [2018-2025], IT-Trainer, IT-Consultant, MCSE: Cloud Platform and Infrastructure, Cisco Certified Academy Instructor.
View all posts by Patrick Gruenauer

Microsoft предлагает всем желающим познакомится с возможностями серверной платформы Windows Server с помощью ознакомительных версий StandardEvaluation или DatacenterEvaluation. Заполнив небольшую форму, вы можете бесплатно скачать ISO или VHD образ с trial версии Windows Server 2022, 2019, 2016 или 2012 R2 c сайта Microsoft Evaluation Center (https://www.microsoft.com/en-us/evalcenter). Такая версия Windows Server предназначена для ознакомления, тестировании или обучения и не может быть использована в коммерческих целях. После установки Windows Server Evaluation у вас есть 180 дней на тестирование ее возможностей.

Если вы умудрились запустить продуктивные задачи на ознакомительной редакции Windows Server Evaluation, есть способ конвертации ее в полноценную full редакцию Windows Server с сохранением данных без полной переустановки операционной системы.

Содержание:

  • Продлить срок действия ознакомительного периода Windows Server Evaluation
  • Как преобразовать Windows Server Evaluation в полную редакцию?
  • Возможные ошибки при конвертации Windows Server Evaluation

Продлить срок действия ознакомительного периода Windows Server Evaluation

При использовании Evaluation версии Windows Server на рабочем столе выводится текущая редакция и время до окончания льготного периода (
Windows License valid for 180 days
).

Также можно получить оставшийся срок действия ознакомительной версии Windows Server с помощью команды:

Slmgr /dli

slmgr /dli - windowsserver timebased_eval_channel

Имя: Windows, ServerStandardEval edition
Описание: Windows Operating System, TIMEBASED_EVAL channel
Состояние: имеет лицензию
Срок действия активации закончится через: xx мин (xx дней)

Ознакомительный период использования Windows Server Evaluation можно легально продлить 5 раз на 180 дней с помощью команды:

slmgr /rearm

Таким образом максимальный срок использования Windows Server Free Trial можно продлить до 3 лет (
180 * 6
).

По истечении срока пробного периода Windows Server начинает требовать активацию и выключаться через каждый час работы со следующим текстом в журнале событий системы:

Процесс C:\Windows\system32\wlms\wlms.exe (<имя>) инициировал действие "Завершить работу" для компьютера <имя> от имени пользователя NT AUTHORITY\СИСТЕМА по причине: Другое (Запланированное)
Код причины: 0x80000000
Комментарий: Истек срок действия лицензии для этой установки Windows. Компьютер завершает работу.

Или:

The license period for this installation of Windows has expired. The operating system will shut down every hour.

Фон рабочего стола при этом становится черным, а в нижнем правом углу уведомление
Windows Licenses is expired
.

Как преобразовать Windows Server Evaluation в полную редакцию?

Microsoft разрешает преобразовать ознакомительную версию Windows Server в полноценную retail Standard/Datacenter редакцию.

Основные ограничения при конвертации:

  • Возможна конвертация только в ту же или более высокую редакцию Windows Server. Например, ServerStandardEval можнопреобразоватьв ServerStandard или ServerDatacenter;
  • Не рекомендуется выполнять конвертацию сервера с ролью контроллера домена AD. Сначала нужно понизить его для рядового сервера (предварительно передав с него FSMO роли, для чего домене должен быть как минимум один дополнительный DC);
  • Если на сервере настроен NIC Teaming, перед обновлением его нужно отключить

Сначала проверьте, что у вас установлена ознакомительная версия Windows Server и текущую редакцию:

DISM /online /Get-CurrentEdition

Выведите список редакций Windows Server, до которых можно обновить текущую Eval версию:

DISM /online /Get-TargetEditions

Editions that can be upgraded to:
Target Edition : ServerStandard
Target Edition : ServerDatacenter

Таким образом вы можете обновить вашу ServerStandardEval до ServerDatacenter или ServerStandard.

Определите вашу версию Windows Server с помощью команды PowerShell:

Get-ComputerInfo | select OsName, WindowsEditionId

powershell: узнать версию и редакцию Windows

Можно выполнить конвертацию как полной GUI версии Windows Server, так и версии Windows Server Core.

Для конвертации ознакомительной версии Windows Server в полноценную нужно использовать общедоступный KMS client setup ключ (или Generic Volume License Key, GVLK) для вашей версии и редакции Windows Server. Полный список ключей для всех версий Windows Server доступен на сайте Microsoft по ссылке Key Management Services (KMS) client activation and product keys. Полный список ключей указан в таблице ниже:

OS version/Edition Standard Datacenter
Windows Server 2022 VDYBN-27WPP-V4HQT-9VMD4-VMK7H WX4NM-KYWYW-QJJR4-XV3QB-6VM33
Windows Server 2019 N69G4-B89J2-4G8F4-WWYCC-J464C WMDGN-G9PQG-XVVXX-R3X43-63DFG
Windows Server 2016 WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY CB7KF-BWN84-R7R2Y-793K2-8XDDG
Windows Server 2012 R2 D2N9P-3P6X9-2R39C-7RTCD-MDVJX KNC87-3J2TX-XB4WP-VCPJV-M4FWM

В данном случае мы хотим выполнить апгрейд Eval редакции до Retail версии Windows Server 2022 Standard. Найдите и скопируйте GVLK ключ для этой версии и редакции Windows Server из таблицы и выполните команду:

dism /online /set-edition:ServerStandard /productkey:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx /accepteula

dism set edition ServerStandard

Если нужно сконвертировать ОС в редакцию Datacenter, нужно использовать параметр
/set-edition:ServerDatacenter
и соответствующий GVLK из таблицы.

Перезагрузите компьютер и проверьте, что ваша Eval редакция Windows Server преобразовалось в полноценную retail.

Теперь нужно активировать ваш Windows Server. Если у вас развернут собственный сервера KMS активации, нацельте ваш хост на него и выполните активацию:

slmgr /skms msk-man02.winitpro.ru:1688
slmgr /ato

Если у вас есть MAK, Retail или OEM ключ для Windows Server, вы можете активировать ОС как обычно: через Интернет или по телефону.

Удалите текущий GVLK ключ:

slmgr.vbs /upk
slmgr.vbs /cpky

Задайте ваш MAK или retail ключ

slmgr.vbs /ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx

Активируйте Windows Server:
slmgr.vbs /ato

Проверьте, что Windows активирована:

Get-CimInstance SoftwareLicensingProduct -Filter "Name like 'Windows%'" | where { $_.PartialProductKey } | select Description, LicenseStatus

LicenseStatus = 1
– указывает, что Windows активирована.

статус активации Windows Server

Возможные ошибки при конвертации Windows Server Evaluation

Некоторые пользователи жалуются, что иногда при выполнении команды DISM /set-edition она зависает на 10%. Если команда зависла более чем на 20 минут, рекомендуем остановить службу Software Protection Service (Защита программного обеспечения) командой
Stop-Service sppsvc -Force
и ограничить доступ ОС в Интернет (можно просто отключить сетевой интерфейс на сервере).

Возможные ошибки DISM:

  • Error 1168. The specified product key could not be validated. Check that the specified product key is valid and that it matches the target edition.
    — Указывает на то, что вместо публичного GVLK ключа, вы указали в команде DISM ваш собственный MAK или Retail ключ. При конвертации всегда используйте GVLK ключ Microsoft, потом вы его замените на ваш собственный ключ продукта;

    dism /online /set-edition Error 1168 The specified product key could not be validated

  • The current edition cannot be upgraded to any target editions
    — значит вы пытаетесь конвертировать Datacenter редакцию в Standard. Такое направление обновления не поддерживается.
  • Error: 50. Setting an Edition is not supported with online images
    или
    Changing this Windows edition is not supported online for a domain controller
    — скорее всего говорит о том, что на сервер развернута роль контроллера домена Active Directory (роль AD DS). Конвертация редакции Windows Server на DC не поддерживается.
  • This Windows image cannot upgrade to the edition of Windows that was specified. The upgrade cannot proceed. Run the /Get-TargetEditions option to see what edition of Windows you can upgrade to
    — ошибка появляется если вы попытаетесь преобразовать Windows Server Evaluation Datacenter в Standard. Мы уже раньше писали, что нельзя обновить Eval Datacenter до Standard. Вам нужно преобразовать редакцию ServerDatacenterEval в ServerDatacenter. Укажите в команде DISM KMS ключ для Datacenter редакции Windows Server.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как включить режим не беспокоить на windows 10
  • Windows server 2008 r2 синий экран при загрузке
  • Создание iso образа средствами windows
  • Как выбрать другого пользователя в windows 10 при входе в систему
  • Realtek usb card reader driver windows 10