Powered by ProofFactor - Social Proof Notifications

Installing and activating the RDS licensing server on Windows Server 2019/2016

Installing and activating the RDS licensing server on Windows Server 2019/2016

Installing and activating the RDS licensing server on Windows Server 2019/2016

In this article, we will look at the process of installing, configuring and activating the Remote Desktop Licensing server role based on Windows Server 2019 and 2016, as well as the procedure for installing and activating client terminals ( RDS CAL ). Let me remind you that after installing the Remote Desktop Session Host terminal server role, users can use it only during a trial period of 120 days, after which the ability to connect to a remote RDS server disappears. According to Microsoft's licensing scheme, all users or devices that connect to an RDS server desktop must be licensed. To account for and issue terminal licenses (RDS CAL), there is a separate service in the role of RDS - Remote Desktop License Server.

You can install Remote Desktop Licensing on any server in the domain, you don't have to install it on one of the servers in the RDSH farm. Before starting the installation of the RDS license server, you need to add this host (or make sure that you have the right to add it) to the Terminal Server License Servers domain group , otherwise the server will not be able to issue an RDS Per User CAL to domain users. You can install the Remote Desktop Licensing service through the Server Manager console. To do this, in the Add Roles and Features wizard, select the Remote Desktop Services role.

Windows RDS server 2019 role assignments

You must select the Remote Desktop Licensing service as the role component.

Windows RDS server 2019 role component

It remains to wait for the installation of the role.

Windows RDS server 2019 installation

The Remote Desktop Licensing Manager console is used to manage the RDS-Licensing service licmgr.exe .

On Windows Server, standard features and roles are easiest to install using PowerShell . To install the RDS Licensing Service and the RD Licensing Diagnoser utility, just run one command:
Install-WindowsFeature RDS-Licensing –IncludeAllSubFeature -IncludeManagementTools
To list the RDS services installed on the server, use the command:
Get-WindowsFeature -Name RDS* | Where installed

Windows RDS server-powershell

In order for the RDS license server to issue licenses to clients, it must be activated. To do this, open the Remote Desktop Licensing Manager console (licmgr.exe ) , right-click on your server name and select the Activate Server menu item.

windows-rds-server-terminal-activation

The RDS Licensing Server Activation Wizard will launch, prompting you to select the desired activation method. If your server has Internet access, it can automatically connect to Microsoft servers. If there is no Internet access from the server, you can activate the server through a web browser or by phone.

winwows rds server connection method

Next, you will need to fill in a number of information about your organization (some fields are required).

windows rds server organisation information

Click Finish button to complete

windows https://offpricesoft.com/images/customation coplete

.

Right-click on the server name in the console and select Review Configuration . Here you can verify that this RDS license server is activated and can be used to activate RDS clients in the 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.

windows https://offpricesoft.com/images/customation confirmation

Each user or device that connects to Remote Desktop Session Host servers must have a client access license ( CAL ). There are two types of terminal CALs.

    • Per device (Per Device CAL ) is a permanent type of license assigned to a computer or device that connects to the RDS server more than once (the first time the device connects, it is issued a temporary license). These licenses are not competitive, i.e. if you have 10 Per Device licenses, then only 10 computers will be able to connect to your RDS server. The current OVL license is called as follows: WinRmtDsktpSrvcsCAL 2019 SNGL OLV NL Each AP DvcCAL

    • Per User (Per User CAL ) - this type of license allows one user to connect to the RDS server from any number of computers / devices. This type of license is tied to a user account in Active Directory, but is not issued forever, but for a certain period of time. The license is issued for a period of 52 to 89 days (random number). The current Open Value license of this type is called: WinRmtDsktpSrvcsCAL 2019 SNGL OLV NL Each AP UsrCAL.

    If you try to use RDS CAL Per User 2019 in a workgroup (not in a domain), then the RDSH server will force logout of users every 60 minutes with the message: “ There is a problem with the Remote Desktop License and your session will be logged out in 60 minutes / There is a problem with your Remote Desktop license, and your session will be disconnected in 60 minutes ”. Therefore, for RDS servers in a workgroup environment , you only need to use Per Device RDS CAL licensing.

    windows 2019 rds server timeout

    Note . Note that the 2016 RDS CAL can only be installed on a license server running Windows Server 2016 or 2019. Installing RDS CALs for newer versions of Windows Server on previous versions of Windows is not supported. Those. you will not be able to install the 2016 RDS CAL on a Windows Server 2012 R2 licensing host. When trying to add new RDS CAL 2019 on Windows Server 2016, an error will appear:

    windows server 2109 incorrect licence message

    Now you need to install the purchased package of terminal licenses (RDS CAL) on the license server.
    In the Remote Desktop Licensing Manager console, right-click on the server and select Install Licenses.

    windows rds server licences installation

    Select the activation method (automatic, web or telephone) and the licensing program (in our case, the Enterprise Agreement).

    Quite a few enterprise agreement numbers for RDS (4965437) have leaked to the network. Finding numbers I think will not be a problem. Usually you don't even need to look for cracks or activators.

    windows rds server 2019 licence agreement confirmation

    The next steps in the wizard depend on which type of licensing is selected. In the case of an Enterprise Agreement, you must specify its number. If the licensing type is License Pack (Retail Purchase), you will need to provide a 25-character product key obtained from Microsoft or a partner.

    windows rds server 2019 licence key

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

    windows rds server 2019 licences amount

    After that, the server can issue licenses (RDS CALs) to clients.
    You can convert RDS User CALs to Device CALs (and vice versa) using the Convert Licenses context menu in the RD Licensing Manager console.

    windows rds server 2019 licence conversion

    If you run out of free licenses, you can revoke previously issued RDS Device CALs for inactive computers using the following PowerShell script: $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()


    You can revoke up to 20% of Per-Device RDS CALs. Per-User CALs cannot be revoked.

    In the RDS CAL management console, you can generate a license usage report. To do this, select Create Report -> CAL Usage from the server's context menu .

    windows rds server 2019 licence conversion

    However, I prefer to use PowerShell to report RDS CAL usage. The following script will show the remaining number of licenses in all RDS CAL packs: Import-Module

    RemoteDesktopServices -ErrorAction Stop
    Set-Location -Path 'rds:' -ErrorAction Stop
    $licenses Get-Item -Path RDS:LicenseServerLicenseKeyPacks* | Where-Object Name -Like "-Per User-*").Name
    $total=0;
    $issued=0;
    foreach ($license in $licenses) {
    $countGet-Item -Path RDS:LicenseServerLicenseKeyPacks$licenseTotalLicenses).CurrentValue
    $total= $total + $count
    $count2Get-Item -Path RDS:LicenseServerLicenseKeyPacks$licenseIssuedLicensesCount).CurrentValue
    $issued= $issued + $count2
    }
    $available = $total - $issued
    Write-Host "Total Licenses available: $available"


    You can run this PowerShell script through Zabbix and generate an alert if the remaining number of licenses is less than 5 for example. The following script will allow you to get a table on the use of Per User licenses:

    Import-Module RemoteDesktopServices -ErrorAction Stop
    Set-Location -Path 'rds:' -ErrorAction Stop
    $path = “C:LogsReportsRDS_CAL_Report.csv”
    $fileName Invoke-WmiMethod Win32_TSLicenseReport -Name GenerateReportEx).FileName
    $fileEntries Get-WmiObject Win32_TSLicenseReport | Where-Object FileName -eq
    $fileName).FetchReportEntries(0,0).ReportEntries
    $objArray = @()
    foreach($entry in $fileEntries){ $objArray += $entry | select User, ProductVersion, CALType, ExpirationDate
    $objArray[-1].User = $objArray[-1].User.Split('') | select -Last 1
    $time = $objArray[-1].ExpirationDate.Split('.') | select -first 1
    $objArray[-1].ExpirationDate = [datetime]::ParseExact($time, "yyyyMMddHHmmss", $null)
    }
    $objArray | Export-Csv -Path $path -Delimiter ',' -NoTypeInformation

    windows 2019 rds server licence conversion confirmation

    If you want to move your set of RDS CALs from one Remote Desktop license server to another, you can remove installed licenses from the license server using PowerShell. The following command will list the installed RDS license packages on the server:


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

    windows RDS server 2019 key pack

    Find the KeyPackId value for the RDS CAL package you want to remove and issue the command: wmic /namespace:rootCIMV2 PATH Win32_TSLicenseKeyPack CALL UninstallLicenseKeyPackWithId KEYPACKID You can also completely remove all CAL sets by recreating the RDS license database. To do this, stop the Remote Desktop Licensing service:

    Stop-Service TermServLicensing

    Rename the file C:WindowsSystem32lserverTLSLic.edb to C:WindowsSystem32lserverTLSLic.bak and start the service:

    Start-Service TermServLicensing

    After that, all RDS CAL licenses will be deleted and you must reactivate them.

    After activating the RDS License Server service, you can reconfigure the RD Session Host terminal servers to receive licenses from this server. Select the license type and specify the terminal server name from the Server Manager GUI, PowerShell, or Group Policy.

    To change the license server address on the RDS host, open Server Manager -> Remote Desktop Services -> Collections. From the top right menu of “ Tasks ”, select “ Edit Deployment Properties ”.

    windows rds server 2019 edit deployment

    In the settings, go to the RD Licensing tab , select the type of licensing (Select the Remote Desktop licensing mode) and the RDS license server (Specify a license server). Click Add -> Ok.

    windows server 2019 configure deployment

    If the licensing type is not set on the RDSH server, you will encounter the error “ No licensing mode set for RD Session Host server ”.

    You can change the RDS license server address and CAL type using PowerShell:

    $obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting

    Then specify the type of licensing you want:

    $obj.ChangeMode(4)

    Note . 4 is specified if the server should use the Per User licensing type, 2 if Per Device.

    Now you can specify the name of the RDS license server:

    $obj.SetSpecifiedLicenseServerList("rds-lic1.yourserver name")

    And check the settings:

    $obj.GetSpecifiedLicenseServerList()

    If you want to assign RDS license server settings through group policies, you need to create a new GPO and assign it to the OU with RDS servers (or you can specify the name of the RDS license server using the local group policy editor - gpedit.msc ). Licensing settings are set in the section: Computer Configuration -> Policies -> Admin Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Licensing.

    There are 2 policies of interest to us in this section:

    • Use the specified Remote Desktop license servers - the address of the RDS licensing server is indicated here;
    • Set the Remote Desktop licensing mode - selection of the licensing method (client license type - RDS CAL).

    windows rds server 2019 licensing mode

    RDSH hosts access the RDS Licensing server on the following ports to obtain licenses. Make sure they are not being blocked by firewalls (or 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 dynamic address range

    You can check port availability using the PortQry utility or the Test-NetConnection cmdlet .

    You can check the status of the license server and the number of issued licenses using the Remote Desktop Licensing Diagnoser utility (lsdiag.msc). The RD Licensing Diagnoster utility can be installed on servers with the RDSH role via (Server Manager: Features -> Remote Server Administration Tools -> Role Administration Tools -> Remote Desktop Services Tools -> Remote Desktop Licensing Diagnoser Tools).
    If the RDSH server is not configured to use the RDS license server, the following warnings will be displayed in the Licensing Diagnoser console:


    • 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.

    windows rds server 2019 no warning message

    alert] If you installed RDSH on the Windows Server Evaluation edition, don't forget to upgrade it to the full version according to the instructions . Without conversion, RDSH services on such a host will only work for 120 days even after you point it to an activated RDS license server.[/alert] If there are no warnings and you see the message “ RD Licensing Diagnoser did not identify any licensing problems for the Remote Desktop Session Host server ”, then the RDSH server can obtain RDS CALs for users.

    windows rds server licence

     

    Note: In our case, after specifying a new licensing server, an error “The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license” began to appear on the RDP client when connecting. The solution is to remove the L$RTMTIMEBOMB key from the registry.