Windows server 2016 rds licensing

Сервер Remote Desktop Licensing используется для выдачи и отслеживания клиентских терминальных лицензий RDS (CAL). Согласно схеме лицензирования Microsoft все пользователи, или устройства, подключающиеся к графическому сеансу рабочего стола RDS, должны быть лицензированы. В этой статье мы рассмотрим, как установить и активировать роль сервера лицензирования удаленных рабочих столов на хосте с Windows Server 2022, 2019 и 2016, а также как установить клиентские лицензии RDS CAL.

Содержание:

  • Установка роли Remote Desktop Licensing в Windows Server
  • Активация сервера лицензий RDS на Windows Server
  • Установка клиентских лицензий RDS CAL в Windows Server
  • Настройка серверов RDSH на использование сервера лицензий RDS
  • Управление клиентскими лицензиями CAL на RDS

Установка роли Remote Desktop Licensing в Windows Server

Компонент Remote Desktop Licensing можно установить на любом хосте Windows Server (не обязательно устанавливать его на одном из серверов фермы RDS). Если вы разворачиваете хост RD Licensing в домене AD, добавьте сервер во встроенную группу Terminal Server License Servers (иначе сервер не сможет выдать CAL типа RDS Per User пользователям домена).

Состав этой группы позволяют быстро найти все хосты с лицензиями RDS в домене.

Установите службу Remote Desktop Licensing через консоль Server Manager (Add Roles and Features -> Remote Desktop Services -> Remote Desktop Licensing.

Remote Desktop Licensing - служба лицензирования терминалов

Дождитесь окончания установки роли.

установка службы Remote Desktop Licensing

Также вы можете в Windows Server установить компонент лицензирования RDS и инструменты управления RD Licensing с помощью PowerShell:
Install-WindowsFeature RDS-Licensing –IncludeAllSubFeature -IncludeManagementTools

Выведите установленные компоненты RDS на сервере и проверьте, что RDS-Licensing и RDS-Licensing-UI установлены:

Get-WindowsFeature -Name RDS* | Where installed

powershell проверить какие службы RDS установлены на Windows Server

Для управления службой RDS-Licensing используются две консоли:

  • Remote Desktop Licensing Manager (
    licmgr.exe
    )
  • RD Licensing Diagnoser (
    lsdiag.msc
    )

Консоли управления сервером лицензирования RDS

Активация сервера лицензий RDS на Windows Server

Чтобы сервер лицензирования RDS мог выдавать лицензии клиентам, его необходимо активировать. Откройте консоль Remote Desktop Licensing Manager (
licmgr.exe
), щелкните ПКМ по имени вашего сервера и выберите пункт меню Activate Server.

активация сервера терминальных лицензий

В мастере активации сервера лицензирования RDS нужно выбрать, хотите ли вы активировать сервер через интернет, с помощью браузера или по телефону.

выберите метод активации сервера лицензирования

Далее нужно будет заполнить ряд информации о вашей организации (часть полей является обязательными).

информация об организации и компании

Нажмите кнопку Finish. Должна появится надпись:

The license server has been successfully activated.

сервер лицензирования RDS успешно активирован

Щелкните в консоли по имени сервера и выберите Review Configuration. В этом примере сервер лицензий RDS активирован и может выдавать лицензии клиентам в домене AD.

This license server is a member of the Terminal Server License Servers group in Active Directory. This license server will be able to issue RDS Per User CALs to users in the domain, and you will be able to track the usage of RDS Per User CALs.
This license server is registered as a service connection point (SCP) in Active Directory Domain Services.

Review Configuration

Установка клиентских лицензий RDS CAL в Windows Server

Теперь на сервер лицензирования нужно установить приобретенный вами пакет терминальных лицензий (RDS CAL, client access license). Есть два типа терминальных CAL:

  • На устройство (Per Device CAL) – лицензия назначается на устройство (компьютер). Дает право подключения к RDS серверам с одного устройства любому количеству пользователей. При первом подключении устройства к RDS ему назначается временная лицензия, а при втором – постоянная. Лицензия не являются конкурентными, это означает что если у вас 10 лицензий Per Device, то к вашему RDS серверу смогут подключится всего 10 компьютеров. Актуальная OVL лицензия называется так:
    Win Remote Desktop Services CAL 2022 SLng OLV NL AP DCAL
  • На пользователя (Per User CAL) – лицензия позволяет одному пользователю подключаться к RDS с любого количества компьютеров. Этот тип лицензии привязывается к учетной записи пользователя в Active Directory, но выдается не навсегда, а на срок от 52 до 89 дней (случайное число). Актуальная Open Value лицензия этого типа называется так:
    Win Remote Desktop Services CAL 2022 SLng OLV NL AP UCAL
    .

    Если вы разворачиваете RDSH сервер в рабочей группе (не в домене), используйте лицензирование на устройство (Per Device RDS CAL). Иначе RDSH сервер будет каждые 60 минут завершать сеанс пользователей с сообщением: “Проблема с лицензией удаленных рабочих столов и ваш сеанс будет завершен через 60 мин / There is a problem with your Remote Desktop license, and your session will be disconnected in 60 minutes ”.

    Проблема с лицензией удаленных рабочих столов и ваш сеанс будет завершен через 60 мин

Клиентские лицензия RDS которые вы используете должны быть совместимы с версией Windows Server, к которой подключается пользователь или устройство. Следующая таблица позволяет определить совместимость RDS CAL с версий Windows Server на сервере лицензирования RDS:

2008 R2 СAL 2012 CAL 2016 CAL 2019 CAL 2022 CAL
2008 R2 Yes No No No No
2012 Yes Yes No No No
2012 R2 Yes Yes No No No
2016 Yes Yes Yes No No
2019 Yes Yes Yes Yes No
2022 Yes Yes Yes Yes Yes

Примечание. RDS CAL для новых версий Windows Server нельзя установить на предыдущие версии WS. Например, вы не сможете установить 2022 RDS CAL на хост лицензирования Windows Server 2016. При попытке установить новые лицензии на старую версию Windows Server появится ошибка:

rds ошибка неверный код при добавлении лицензий RDS CAL

RD Licensing Manager
The license code is not recognized. Ensure that you have entered the correct license code.

В консоли Remote Desktop Licensing Manager щелкните по серверу и выберите Install Licenses.

Выберите способ активации (автоматически, через веб или по телефону) и программу лицензирования (в нашем случае Enterprise Agreement).

В сеть утекло уже довольно много enterprise agreement номеров для RDS (4965437). Найти номера думаю, не составит проблемы. Обычно даже не нужно искать кряки или активаторы.

программа лицензирования Enterprise Agreement

Следующие шаги мастера зависят от того, какой тип лицензирования выбран. В случае Enterprise Agreement нужно указать его номер. Если выбран тип лицензирования License Pack (Retail Purchase), нужно будет указать 25-символьный ключ продукта, полученный от Microsoft или партнера.

номер лицензионного соглашения

Укажите тип продукта (Windows Server 2022, 2019 или 2016), тип RDS CAL и количество терминальных лицензий, которые нужно установить на сервере.

тип и количество RDS лицензий

Если нужно сконвертировать RDS лицензии User CAL в Device CAL (или наоборот), щелкните по пакету лицензий в консоли RD Licensing Manager и выберите Convert Licenses.

сонвертировать rds cal из user в device

Настройка серверов RDSH на использование сервера лицензий RDS

После установки роли RDSH на Windows Server пользователю могут использовать его в течении пробного (grace) периода 120 дней, после чего они не смогут подключиться к RDS. Чтобы ваши RDSH хосту могли получать CAL лицензии с RDS License сервера и выдавать их устройствам/пользователям, нужно указать адрес сервера с RDS лицензиями в настройках терминальных серверов RD Session Host.

Можно задать адрес сервера лицензирования в настройка коллекции на RDSH. Откройте Server Manager -> Remote Desktop Services -> Collections. В правом верхнем меню выберите Tasks -> Edit Deployment Properties.

rds изменить настройки Edit Deployment Properties

Перейдите на вкладку RD Licensing, выберите тип лицензирования (Per user или Per device в зависимости от имеющихся лицензий) и адрес сервера RDS. Нажмите Add -> Ok.

rdsh изменить параметры лицензирования хоста

Можно задать настройки сервера лицензирования RDS через групповые политики. В домене нужно создать нужно создать новую GPO в консоли GPMC и назначить ее на OU с RDS серверами (либо вы можете указать имя сервера лицензирования RDS с помощью локального редактора групповых политик –
gpedit.msc
).

Перейдите в раздел Computer Configuration -> Policies -> Admin Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Licensing и настройте два параметра.

  • Use the specified Remote Desktop license servers – укажите имя или IP адрес сервера лицензирования RDS;
  • Set the Remote Desktop licensing mode – выбор тип клиентских лицензий (RDS CAL).

GPO - data-lazy-src=

Если вы установили RDSH на ознакомительной редакции Windows Server Evaluation, нужно конвертировать его в полноценную версию согласно инструкции. Без конвертации службы RDSH на таком хосте будут работать только 120 дней даже после того, как вы нацелите его на активированный сервер лицензий RDS.

Также можно задать имя сервера лицензирования RDS и тип CAL с помощью PowerShell. Если у вас развернут посредник RDS Connection Broker, можно изменить настройки лицензирования с помощью команды:

Set-RDLicenseConfiguration -LicenseServer @("rds-lic01.winitpro.loc") -Mode PerDevice -ConnectionBroker "rdcb01.winitpro.loc"

Либо вы можете указать адрес сервера лицензирования и тип лицензий в реестре с помощью PowerShell команд:

# Тип лицензирования RDS 2 – Per Device CAL, 4 – Per User CAL
$RDSCALMode = 4
# Имя сервера лицензирования RDS
$RDSlicServer = "rds-lic01.winitpro.loc"
New-Item "HKLM:\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers"
New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers" -Name SpecifiedLicenseServers -Value $RDSlicServer -PropertyType "MultiString"
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core\" -Name "LicensingMode" -Value $RDSCALMode

Хосты RDSH для получения лицензий с сервера RDS Licensing обращаются к нему по следующим портам. Убедитесь, что они не блокируются межсетевыми экранами (или Windows Firewall):

  • TCP/135 (Microsoft RPC)
  • UDP/137 (NetBIOS Datagram Service)
  • UDP/138 (NetBIOS Name Resolution)
  • TCP/139 (NetBIOS Session Service)
  • TCP/445 (SMB)
  • TCP 49152 – 65535 — RPC динамический диапазон адресов

Вы можете проверить доступность портов с помощью утилиты PortQry или командлета Test-NetConnection.

Запустите утилиту Remote Desktop Licensing Diagnoser (
lsdiag.msc
) на RDSH хосте и проверьте, что он видит сервер лицензирования и количество доступных RDS CAL.

RD Licensing Diagnoser did not identify any licensing problems for the Remote Desktop Session Host server.

RD licensing diagnoser: проверить подключение к серверу лицензирования

Если сервер сервера лицензий RDS не задан, или недоступен, в консоли Licensing Diagnoser будут присутствовать следующие предупреждения:

Licenses are not available for this Remoter Desktop Session Host server, and RD Licensing Diagnose has identified licensing problems for the RDSH
Number of licenses available for clients: 0
The licensing mode for the Remote Desktop Session Host server is not configured
Remote Desktop Session Host server is within its grace period, but the RD Session Host server has not been configured with any license server.

rds diagnoser недоступны лицензии

Примечание. В нашем случае после указания нового сервера лицензирования, на RDP клиенте при подключении стала появляться ошибка
The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license
. Решение – удаление ключа L$RTMTIMEBOMB из реестра.

Можете подключиться к RDSH серверу с клиента и проверить, что сервер лицензирования назначил RDS CAL подключению. Откройте консоль Event Viewer и перейдите Applications and Services Logs -> Microsoft -> Windows -> TerminalServices-Licensing -> Operational. Событие успешной выдачи RDS CAL с Event ID 82 будет содержать такую надпись:

The "Temporary"  Windows Server 2022 : RDS Per Device CAL belonging to computer "DESKTOP-S6G9U9C" has been upgraded to "Permanent" Windows Server 2022 : RDS Per Device CAL.

Логи выдачи RDS лицензий в Event Viewer

Управление клиентскими лицензиями CAL на RDS

Рассмотрим несколько типовых инструментов администратора при управлении RDS CAL на сервере лицензирования.
Вы можете в консоли управления RD Licensing Manager отчет об использовании лицензий RDS CAL. Для этого в контекстном меню сервера выберите Create Report -> CAL Usage.

Вывести информацию по установленным и используемым лицензиям RDS CAL с помощью PowerShell:

Get-WmiObject Win32_TSLicenseKeyPack|select-object KeyPackId,ProductVersion,TypeAndModel,AvailableLicenses,IssuedLicenses |ft

rdc licensing cal Win32_TSLicenseKeyPack

Если у вас закончились свободные лицензии, вы можете отозвать ранее выданные лицензии RDS Device CAL для неактивных компьютеров из консоли (правой кнопкой по лицензии и выберите Revoke License.

RDS CAL отозвать лицензию

Также вы можете отозвать RDS CAL с помощью скрипта PowerShell:

$RevokedPCName=”msk-pc2332”
$licensepacks = Get-WmiObject win32_tslicensekeypack | where {($_.keypacktype -ne 0) -and ($_.keypacktype -ne 4) -and ($_.keypacktype -ne 6)}
$licensepacks.TotalLicenses
$TSLicensesAssigned = gwmi win32_tsissuedlicense | where {$_.licensestatus -eq 2}
$RevokePC = $TSLicensesAssigned | ? sIssuedToComputer -EQ $RevokedPCName
$RevokePC.Revoke()

Можно отозвать до 20% Per-Device RDS CALs. Per-User CALs отозвать нельзя.

After the sucessfull installation of the Microsoft Remote Desktop (RDS) Licensing component we now need to configure it.

The RD Licensing Manager can be started over a Start Menu link or through a link in the Servermanager. It is not necessary to add RDS Licenses if you are in a lab environment because the License Server will issue temporary licenses for 120 days and in most cases this should be sufficient for a few tests or demos.

The first thing you will notice is that the License Server is not activated. You can see that on the red mark left to the server name.

2016-10-30-17_54_47-server-manager

If you right click on the server name you can open the configuration of the server. You can see that the Discovery Scope of the License Server is configured to Domain.

2016-10-30-17_54_56-homewap0002-configuration

To change the scope the user we use to reconfigure this option needs to have Enterprise Admin privileges in Active Directory. Click CONTINUE.

2016-10-30-17_55_08-rd-licensing-manager

In the next screen you can choose The forest. Click OK.

2016-10-30-17_55_17-rd-licensing-manager

Choosing Forest makes this Licensing Server available to multiple domains within the forest. Click OK again to finish the configuration for the scope.

2016-10-30-17_55_27-rd-licensing-manager

In the next step we will add this License Server to the Terminal Server License group. Without this configuration the License Server won´t issue CALs to users and no reporting will be possible. Click ADD TO GROUP.

2016-10-30-17_55_36-rd-licensing-manager

In the next screen click CONTINUE.

2016-10-30-17_55_41-desktop

Click OK in the next screen to finish the configuration.

2016-10-30-17_55_46-desktop

The next screen shows green checkmarks for all configuration items. Click OK.

2016-10-30-17_55_50-desktop

Now right click on the server name again and start the Activate Server Wizard. Click NEXT.

2016-10-30-17_56_47-activate-server-wizard

There are a few options you can choose to activate the license server. I have internet access and therefor I will leave it on Automatic connection (recommended).

2016-10-30-17_56_55-desktop

In the next screen type in your First name, last name, company and Country. Click NEXT.

2016-10-30-17_57_25-rd-licensing-manager

Add further company information. Click NEXT.

2016-10-30-17_57_53-rd-licensing-manager

With the next screen we are ready to activate the license server. Leave the checkmark next to Start Install Licenses Wizard now activated.

2016-10-30-17_58_05-rd-licensing-manager

The Activate Server Wizard opens. Click NEXT.

2016-10-30-17_58_14-desktop

Again we have a few options to choose for a license program. As Microsoft partner we have access to a few licenses. I will leave License Pack (retail Purchase).

2016-10-30-18_04_14-activate-server-wizard

On the next screen we need to type in a License code. Click ADD and NEXT.

We´re done with adding Licenses. Click FINISH.

2016-10-30-18_05_23-rd-licensing-manager

Now you should be able to see the newly added Licenses in the RD Licensing Manager.

2016-10-30-18_12_09-rd-licensing-manager

That´s your Microsoft RDS Licensing server on Windows Server 2016.

The Remote Desktop Licensing server is used to issue and track RDS client terminal access licenses (CALs). Microsoft’s licensing policy requires all users or devices connecting to desktop sessions on RDS to be licensed. In this article, we’ll look at how to install and activate the Remote Desktop Licensing server role on a host running Windows Server 2022, 2019 or 2016, and how to install RDS CALs.

Contents:

  • Install the Remote Desktop Licensing Role on Windows Server
  • Activate the Remote Desktop Services License Server
  • Install RDS Client Access Licenses (CALs) on Windows Server
  • Configure Licensing Settings on RD Session Hosts
  • Managing Remote Desktop CALs

Install the Remote Desktop Licensing Role on Windows Server

The Remote Desktop Licensing feature can be installed on any Windows Server host. It is not necessary to install it on one of the servers in the RDS farm. If you are deploying an RD Licensing host in an AD domain, add the server to the built-in Terminal Server License Servers group (otherwise, the host will not be able to issue RDS Per User CALs to domain users).

By listing the members of this group, you can quickly find all hosts with RDS licenses in the domain.

Install the Remote Desktop Licensing service from the Server Manager console (Add Roles and Features -> Remote Desktop Services -> Remote Desktop Licensing).

Remote Desktop Services Licensing service

Wait for the role to be installed.

RDS licensing feature installation

On Windows Server, you can also use PowerShell to install the RDS Licensing service and the RD Licensing management tools.

Install-WindowsFeature RDS-Licensing –IncludeAllSubFeature -IncludeManagementTools

List the RDS features installed on the server and check that RDS-Licensing and RDS-Licensing-UI are installed:

Get-WindowsFeature -Name RDS* | Where installed

rds licensing role install with powershell

Two MMC consoles are used to manage the RDS Licensing service.

  • Remote Desktop Licensing Manager (licmgr.exe)
  • RD Licensing Diagnoser (lsdiag.msc)

RDS license management snap ins

Activate the Remote Desktop Services License Server

To issue licenses to RDP clients, your RDS License Server must be activated. Open the Remote Desktop Licensing Manager (licmgr.exe), right-click the name of your server, and select Activate Server.

activa rds licensing server

In the RDS licensing server activation wizard, choose whether you want to activate the server over the Internet, using a browser, or by phone.

RDS license server automatic activation

Next, fill in some information about your company (some fields are required).

rds license company info

Click the Finish button. The following message should appear:

The license server has been successfully activated.

rds license server has been successfully activated

Click on the server name in the console and select Review Configuration. In this example, the RD license server is enabled and can issue licenses to clients in the AD domain.

  • This license server is a member of the Terminal Server License Servers group in Active Directory. This license server will be able to issue RDS Per User CALs to users in the domain, and you will be able to track the usage of RDS Per User CALs.
  • This license server is registered as a service connection point (SCP) in Active Directory Domain Services.

review rds activation info

Install RDS Client Access Licenses (CALs) on Windows Server

Now you need to install the terminal client access license (RDS CAL) pack you have purchased on the license Server. There are two types of RDS CALs:

  • Per-Device CAL – it is the permanent license assigned to a computer (device) that connects to the RDS server more than once (a temporary licensee is issued when a device is connected for the first time.) These licenses are not concurrent, so if you have 10 Per-Device licenses, only 10 computers can connect to your RDS host. The current OVL RDS CAL is called: Win Remote Desktop Services CAL 2022 SLng OLV NL AP DCAL ;
  • Per-User CAL – the license allows a user to connect to the RDS from any number of computers/devices. This type of license is linked to a user account in Active Directory. It is issued for a period of 52 to 89 days (random number).  The current Open Value license of this type is called Win Remote Desktop Services CAL 2022 SLng OLV NL AP UCAL.

    If you are deploying an RD host in a workgroup (without an AD domain), use Per Device RDS CALs.  Otherwise, the RDSH server will forcibly terminate the user session every 60 minutes:

    Remote Desktop License Issue: There is a problem with your Remote Desktop license, and your session will be disconnected in 60 minutes

    Remote Desktop License Issue:There is a problem with your Remote Desktop license, and your session will be disconnected in 60 minutes

The RDS CALs you use must be compatible with the version of Windows Server that the users or devices are connecting to. To determine the compatibility of RDS CAL with versions of Windows Server on the RD license server, please refer to the following table:

2008 R2 CAL 2012 CAL 2016 CAL 2019 CAL 2022 CAL
2008 R2 Yes No No No No
2012 Yes Yes No No No
2012 R2 Yes Yes No No No
2016 Yes Yes Yes No No
2019 Yes Yes Yes Yes No
2022 Yes Yes Yes Yes Yes

RDS CALs for new versions of Windows Server cannot be installed on previous versions of WS. For example, you won’t be able to install the 2022 RDS CALs on a Windows Server 2016 licensing host. An error occurs when trying to install new RDS CALs on an older version of Windows Server:

RD Licensing Manager
The license code is not recognized. Ensure that you have entered the correct license code.

rds license code is not recognized

Right-click your host in the Remote Desktop Licensing Manager console and select Install Licenses.

Select the activation method (automatic, online, or by phone) and the license program (in our case, it is Enterprise Agreement).

Several RDS enterprise agreement numbers have been leaked on the internet (4965437), you don’t even need to look for rds cracks or activators.

rds cal - enterprise agreement

The next steps of the wizard depend on which license program you have selected. In the case of an Enterprise Agreement, you must provide its number. If you have chosen License Pack (Retail Purchase), enter the 25-character product key that you received from Microsoft or a partner.

rds cal - agreement number

Specify the product version (Windows Server 2022, 2019, or 2016), the RDS CAL type, and the number of terminal licenses to be installed on the server.

select license type and number of RDS CALs

You can convert RDS User CALs to Device CALs (and vice versa) using the Convert Licenses option in the RD Licensing Manager console.

Convert RDS CALs

Configure Licensing Settings on RD Session Hosts

Users can use the RDSH role for a grace period of 120 days after it is installed on Windows Server, after which they won’t be able to connect to RDS. For your RDSH host to receive CALs and issue them to devices/users, you must specify the address of the RD licenses server in the RD Session Host settings.

To change the name/address of the licensing server on the RDS host, open Server Manager -> Remote Desktop Services -> Collections. In the upper right menu “Tasks” select “Edit Deployment Properties”.

rds Edit Deployment Properties

Go to the RD Licensing tab, select the licensing type (Per user or Per device depending on the CALs you have), and license server address. Click Add -> OK.

set rd license server via server manager

The RDS licensing server settings on the RDS host can be set using Group Policy. You can create a new domain GPO using the GPMC console and assign it to the OU with RDS hosts. Or you can use the local Group Policy Editor to set the address of the RDS license server.  Or use the local Group Policy Editor (gpedit.msc) to set the RDS licensee server address.

Go to Computer Configuration -> Policies -> Admin Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Licensing and configure the following options:

  • Use the specified Remote Desktop license servers – specify the name or the IP address of the server where the RDS license is installed;
  • Set the Remote Desktop licensing mode – select the license type for RDS CALs.

gpo - Use the specified Remote Desktop license servers

If you have installed RDSH on the Windows Server Evaluation edition, you must convert it to the full version according to this guide. Without an upgrade, RDSH services on such a host will only work for 120 days, even if you target it to an activated RDS license server.

You can also use PowerShell to set the RDS licensing server name and CAL type. If you have RDS Connection Broker deployed, you can change your licensing settings using the command:

Set-RDLicenseConfiguration -LicenseServer @("rds-lic01.woshub.loc") -Mode PerDevice -ConnectionBroker "rdcb01.woshub.loc"

Or you can specify the licensing server address and license type directly in the registry using PowerShell:

# RDS licensing type: 2 – Per Device CAL, 4 – Per User CAL
$RDSCALMode = 4
# RDS license server name
$RDSlicServer = "rds-lic01.woshub.loc"
New-Item "HKLM:\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers"
New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\TermService\Parameters\LicenseServers" -Name SpecifiedLicenseServers -Value $RDSlicServer -PropertyType "MultiString"
Set-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core\" -Name "LicensingMode" -Value $RDSCALMode

RDS hosts connect to the RDS Licensing Server using the following ports to obtain client licenses. Make sure they are not blocked by firewalls (or Windows Defender Firewall):

  • TCP/135 – Microsoft RPC;
  • UDP/137 – NetBIOS Datagram Service;
  • UDP/138 – NetBIOS Name Resolution;
  • TCP/139 – NetBIOS Session Service;
  • TCP/445 – SMB;
  • TCP/49152–65535 – RPC dynamic address range

To check port availability, use the Test-NetConnection cmdlet or the PortQry tool.

Run the Remote Desktop Licensing Diagnoser (lsdiag.msc) on the RDSH and check that it sees the licensing server and the number of RDS CALs available.

If there are no warnings, and you see the message, then the RDSH server can successfully receive RDS CALs for remote users and/or devices.

RD Licensing Diagnoser did not identify any licensing problems for the Remote Desktop Session Host server.

RD Licensing Diagnoser did not identify any licensing problems for the Remote Desktop Session Host server

The following warnings are displayed in the Licensing Diagnoser console if the RDS license server is not configured or is unavailable:

  • Licenses are not available for this Remoter Desktop Session Host server, and RD Licensing Diagnose has identified licensing problems for the RDSH.
  • Number of licenses available for clients: 0
  • The licensing mode for the Remote Desktop Session Host server is not configured.
  • Remote Desktop Session Host server is within its grace period, but the RD Session Host server has not been configured with any license server.

rds licensing diagnoser licenses are not available

In our case, the RDP client connection error appeared after specifying a new RD Licensing server.

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

The solution is to remove the L$RTMTIMEBOMB key from the registry on the RDSH server.

Connect to the RDSH server from the client and check that the licensing server has issued an RDS CAL. Open the Event Viewer console and navigate to Applications and Services Logs -> Microsoft -> Windows -> TerminalServices-Licensing -> Operational. Event ID 82 should contain the following description for a successfully issued RDS CAL.

The "Temporary" Windows Server 2022 : RDS Per Device CAL belonging to computer "DESKTOP-PCNAME1" has been upgraded to "Permanent" Windows Server 2022 : RDS Per Device CAL.

RDS-CALs assigned to client in event viewer log

Managing Remote Desktop CALs

Let’s have a look at several typical administrator tasks in the management of RDS CAL on a licensing server.

A report of RDS CAL license usage can be obtained from the RD Licensing Manager console. Right-click server and select Create Report -> CAL Usage.

View information on installed and used RDS CALs using PowerShell:

Get-WmiObject Win32_TSLicenseKeyPack|select-object KeyPackId,ProductVersion,TypeAndModel,AvailableLicenses,IssuedLicenses |ft

Win32_TSLicenseKeyPack get RDS CAL packs installed

If you are running out of free client licenses, you can revoke a previously issued RDS Device CAL for an inactive computer from the console (Right-click on the license and select Revoke License).

revoke RDS CAL

You can also use a PowerShell script to revoke a previously issued RDS device CAL:

$RevokedPCName=”lon-bc1-123”
$licensepacks = Get-WmiObject win32_tslicensekeypack | where {($_.keypacktype -ne 0) -and ($_.keypacktype -ne 4) -and ($_.keypacktype -ne 6)}
$licensepacks.TotalLicenses
$TSLicensesAssigned = gwmi win32_tsissuedlicense | where {$_.licensestatus -eq 2}
$RevokePC = $TSLicensesAssigned | ? sIssuedToComputer -EQ $RevokedPCName
$RevokePC.Revoke()

Up to 20% of per-device RDS CALs can be revoked. Per-User CALs cannot be revoked.

The last piece of the puzzle is RD Licensing server. Each server already has 2 CALs for admins and that’s each and every server, but the idea is that there are just going to be used by admins to remote desktop in and go through and configure the server. Once we install RDS we must install a license server within 120 days or RD Sessions services will stop. Once we have installed the server we have to activate it and we need to purchase Client Access License, or CALs that match the licensing mode that we choose.

WE HAVE 2 MODES:

  • PER USER – One user (using any device) can use RDS functionality on any server

An RDS User CAL means that you’re licensing the user, so one user using any device, and in fact they can use multiple devices at the same time, can use Remote Desktop Services functionality on any server. So let’s say you have executives that have both a desktop and a laptop, and even some type of a tablet, they could remote desktop on all of those devices, and even simultaneously, and you would still be within your licensing requirements. When you move over to user CALs, or the user mode, you need to make sure that you buy the appropriate amount of licensing. If you have it set to Per User, it accepts any and all connections. It’s on you to make sure that you’ve bought the appropriate number of CALs and that you’re obeying your licensing agreement.

  • PER DEVICE – One device (used by any user) can use RD on any server

This allows one device to be used by any user to connect up to Remote Desktop Services on any server. So let’s say you have a warehouse and you have one desktop out there, but 10 people use it. You could get away with buying one RDS Device CAL, and that particular desktop would have a CAL assigned to it, and anyone who used it would be able to use Remote Desktop Services. When it’s set to device, the once of the number of CALs is used up, the Remote Desktop server will refuse additional connections.

RD LICENSING SERVER AND CAL VERSIONS

Keep in mind that CALs must correspond to the version of Windows Server that the user or device is connecting to. Another important thing to note is that if your RD Licensing server is 2016 then you can host CALs from all previous versions but if it is 2012 then you can host CALs older then 2012 and that version. In other words, you cannot use a 2012 RD Licensing server to service Server 2016 RDSH or RDVH servers.

CONVERT 2012 CALs to 2016

This is the question that comes a lot when we speak about RD Licensing and the answer is that there is no method which we can use to convert our licenses from 2012 to 2016. We can do an in-place upgrade which I am not a fan of (You will need to delete the database and upgrade the server) or we can install new Windows Server 2016 and install Licensing role on it with 2016 CALs and decommission the old RD Licensing server.

(I will show you later how you can remove Licensing Pack with powershell, in case that you have a lot of licensing packs on your RD Server and you need to remove just specific one without rebuilding the database)

Let’s go ahead and install the RD Licensing role. I will install it on DC01. (If you wonder why am I installing it on a domain controller be sure to check PART 10 -It will be available soon). Be sure to add your licensing server in ALL SERVERS in Server manager before you go and install the role.  Click on the RDS Node –> Overview and then click on the RD Licensing

2018-03-20 13_14_08-RDCB01 on HYPER - Virtual Machine Connection

Select your server and click on Next and ADD

2018-03-20 13_16_57-RDCB01 on HYPER - Virtual Machine Connection.png

and after a few seconds we will have our RD Licensing role installed.

2018-03-20 13_31_09-RDCB01 on HYPER - Virtual Machine Connection.png

Now the RD Licensing role is installed we need to activate it. To do this we need to launch the Remote Desktop Licensing Manager. I will switch to DC01 and open Licensing Manager. Open Server Manager –> Tools –> Remote Desktop Services –> RD Licensing Manager

2018-03-20 13_36_53-.png

You will notice that the Activation Status is Not Activated. (I will not be able to finish the wizard because I don’t have licenses in my test environment but I will show you the steps)

2018-03-20 13_38_36-DC01 on HYPER - Virtual Machine Connection.png

Right click your server name then click Activate Server

On the Welcome Wizard screen Click Next. If your computer is connected to the internet leave it on Automatic connection or choose between Web Browser or Telephone connection and click Next

2018-03-20 13_46_06-DC01 on HYPER - Virtual Machine Connection.png

Enter your information and click Next

2018-03-20 13_48_40-DC01 on HYPER - Virtual Machine Connection.png

This is just an optional page so if you want you can enter additional information or you can just click Next

2018-03-20 13_49_58-DC01 on HYPER - Virtual Machine Connection.png

You will notice that Start Install Licenses Wizard now is checked by default. Click Next

2018-03-20 13_51_41-DC01 on HYPER - Virtual Machine Connection.png

On the Welcome Page click Next. On the License Program page we have the option to pick the type of license we want to install. Choose the one purchased and click next

2018-03-20 13_55_37-DC01 on HYPER - Virtual Machine Connection.png

Now we come to the last part where we have to add our license. Once done click Next and Finish

2018-03-20 13_56_38-DC01 on HYPER - Virtual Machine Connection.png

You will see your licenses under the server name.

2018-03-20 13_58_37-DC01 on HYPER - Virtual Machine Connection.png

If you receive yellow warning triangle next to your server name you will need to add your Licensing server into the Active Directory. Usually you will have to do it when you fresh install the licensing server. To do that you can right click on your server and select Review Configuration

Here you will have the option to add it to AD Group.

2018-03-20 14_22_25-Setup RD Licensing Role on Windows Server 2012 R2 - VirtuallyBoring - Internet E.png

Once server is added we will see all greens.

2018-03-20 14_24_15-DC01 on HYPER - Virtual Machine Connection.png

To confirm the license server is added to the AD group we can open ADUC and click on Builtin –> Terminal Server License Servers

2018-03-20 14_25_56-DC01 on HYPER - Virtual Machine Connection.png

Once done we will see our Licensing server and the mode under the Collection Deployment Properties (Licensing Section)

2018-03-20 14_29_59-RDCB01 on HYPER - Virtual Machine Connection

MIGRATE RDS LICENSING SERVER

There may be situations where we need to migrate our CALs to a different server. Again I will not be able to migrate CALs because I don’t have valid onces in my test environemt but I will show you how to do it and what you need to think about when migrating to a different host. Connect to your DESTINATION Licensing server and run Licensing Manager ( You many note that I am running this on my DC01 and it is because I don’t have second licensing server)

Migration process starts by right-clicking on our Licensing server and selecting Manage Licenses

2018-03-20 15_01_54-DC01 on HYPER - Virtual Machine Connection.png

On the Welcome Wizard click next. On the Action Selection page we will focus on the first option and from the drop-down-box select on of the 2 option and select next.

I will choose The source license server is being replaced by this one…

2018-03-20 15_12_33-DC01 on HYPER - Virtual Machine Connection.png

On the Source License Server Information page, enter the name or IP address of the source license server.

  • If the source license server is available on the network, click Next.

2018-03-20 15_27_11-DC01 on HYPER - Virtual Machine Connection.png

At this point, you need to type your keys or agreement number and confirm the licenses with the Add button. When you have added all your licenses click Next and the wizard will transfer the CALs.  Once done you are ready to unauthorize and decommission the old server.

  • If the source license server is not available on the network option , check The specified source license server is not available on the network. Specify the operating system that the source license server is running, and then provide the license server ID for the source license server. To find you server ID you will need to login on the source server and in Licesning Manager right-click on it and select properties

On the Connection Method tab, down at the bottom you can see the license server ID .

2018-03-20 15_28_32-DC01 on HYPER - Virtual Machine Connection

Copy the ID and paste it in the Enter the license server ID for the source license server boxes, then click Next to continue.

2018-03-20 15_38_33-DC01 on HYPER - Virtual Machine Connection.png

Next page will warn us that we will need to manually remove the licenses from the source server, check the box that you agree with it and click on next and follow the wizard.

REMOVE RD LICENSE PACK FROM LICENSING SERVER 

There may be situations where we need to remove only one license pack and not to rebuild the whole database. We will first start with removing one license pack and then we will see how we can rebuild the whole database. The only way to do this is to run powershell. There is no GUI option for this.

In Licensing manager we can see that I have 2 License Packs. One for the Devices and one for Users. I have only Built-in but you can use these commands that I will show you to remove your license packs.

2018-03-21 08_15_20-DC01 on HYPER - Virtual Machine Connection.png

Run powershell as admin and type Get-WmiObject Win32_TSLicenseKeyPack

You will get a list of license packages. Look for the KeyPackId. We will need that Value in our next command

2018-03-21 11_51_12-DC01 on HYPER - Virtual Machine Connection.png

To remove License Package type in

wmic /namespace:\root\CIMV2 PATH Win32_TSLicenseKeyPack CALL UninstallLicenseKeyPackWithId 2

Let’s see now how we can rebuild the RD Licensing database. Start RD Licensing Manager and right-click on your server and select Manage Licenses

On the Welcome screen click Next. On the Action Selection page select Rebuild the license server database and and select the reason… click next

2018-03-21 13_39_03-DC01 on HYPER - Virtual Machine Connection.png

On the confirmation page check the Confirm deletion of licenses…. and click next

2018-03-21 13_40_36-DC01 on HYPER - Virtual Machine Connection.png

And that’s it. Database has been deleted. Now we have the option to reinstall licenses. Click next and follow the wizard.

2018-03-21 13_41_52-DC01 on HYPER - Virtual Machine Connection

Just to point that the database files are located in C:\Windows\System32\lserver\

2018-03-21 13_47_07-DC01 on HYPER - Virtual Machine Connection.png

If you would like to rebuild it manually, you would need to stop the licensing services, rename the database to TLSlic.old and then start the service.

That’s it. I hope you enjoyed reading. I hope that after reading this you have better understanding on how RD Licensing role works.

Thanks for reading!

Cheers,

Nedim

In this article we will see that how to install RDS license , Role and activate. The Remote Desktop Services license server issues client access licenses (CALs) to users and devices when they access the RD Session Host. You can activate the license server by using the Remote Desktop Licensing Manager.

Install the RD Licensing role:-

Sign into the server you want to use as the license server using an administrator account >
In Server Manager > click Roles Summary > then click Add Roles > Click Next on the first page of the roles wizard.

Select Remote Desktop Services > then click Next > then Next on the Remote Desktop Services page >

Select Remote Desktop Licensing > then click Next. 

  then click Next > Click Install > Close (Once installation done).

Activate the license server:-

Open the Remote Desktop Licensing Manager: click Start > Administrative Tools > Remote Desktop Services > Remote Desktop Licensing Manager.

Right-click the license server > then click Activate Server.

Click Next on the welcome page.

For the connection method > select Automatic connection (recommended) > then click Next.

Enter your company information (your name, the company name, your geographic region) > and then click Next > Optionally enter any other company information (for example, email and company addresses) >  then click Next.

Make sure that Start Install Licenses Wizard now is not selected (we’ll install the licenses in a later step) >  and then click Next.

Your license server is now ready to start issuing and managing licenses.

Install RDS client access licenses on the Remote Desktop license server:-

On the license server > open the Remote Desktop Licensing Manager > Right-click the license server > then click Install licenses > Click Next on the welcome page.

Select the program you purchased your RDS CALs & Select the activation method (automatic, online or by phone) and the license program (in our case, it is Enterprise Agreement).

Enter the information for your license program. In most cases, this will be the license code or an agreement number, but this varies depending on the license program you’re using >
Click Next.

Select the product version, license type, and number of licenses for your environment, and then click Next >The license manager contacts the Microsoft Clearinghouse to validate and retrieve your licenses > Click Finish to complete the process.

 Configure GPO for RDS licensing:-

When configuring via GPO, you need to create a new GPO and link it to the OU with RDS servers. The licensing settings are located in the following section of the GPO:

Computer Configuration -> Policies -> Admin Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Licensing

There are 2 policies that we need:

Use the specified Remote Desktop license servers – the address of the License Server is set
Set the Remote Desktop licensing mode – the licensing method is selected

You can check the License Server status and the number of the issued licenses using RD Licensing Diagnoser (Administrative Tools -> Remote Desktop Services -> RD Licensing Diagnoser).

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

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как отменить завершение работы windows 10 по расписанию
  • Простая рисовалка для windows 10
  • Proxy server socks5 windows
  • Windows не удалось завершить форматирование флешки ntfs
  • Windows 11 без tpm torrent