BlueByte
Windows Server RDSFixed

Windows Server RDS: The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license

By Haneul SeoUpdated September 24, 20268 min

Hi, it's BlueByte. Users who connected fine yesterday are now bounced at sign-in with The remote session was disconnected because there are no Remote Desktop License Servers available to provide a license. Nothing crashed and no update ran: a Remote Desktop Session Host that has passed its licensing grace period refuses sessions on purpose until a license server can issue a client access license. We'll walk through the message variants, why the host started refusing, how to confirm the cause in a couple of commands, the fix per cause, and how to keep the deployment from walking into the same wall after an upgrade.

The message users see, and the two the diagnoser adds

Clients get one of two sentences — the licensing one above, or Access was denied because of a security error., which points at a different cause covered at the end. The useful detail is on the server. Sign in to the session host as a domain administrator and open the RD Licensing Diagnoser (Server Manager, then Tools, Terminal Services, RD Licensing Diagnoser). It states the problem in plain words, such as The grace period for the Remote Desktop Session Host server has expired, but the RD Session Host server hasn't been configured with any license servers. Connections to the RD Session Host server will be denied unless a license server is configured for the RD Session Host server. or License server <computer name> is not available. This could be caused by network connectivity problems, the Remote Desktop Licensing service is stopped on the license server, or RD Licensing isn't available. Those two sentences separate "no license server configured" from "configured but unreachable", which is the first fork in this diagnosis.

Why the session host started refusing connections

There is a licensing grace period of 120 days during which no license server is required. Once it ends, clients must have a valid RDS CAL issued by a license server before they can sign in to a remote session. That deadline is what turns a working lab deployment into an outage four months later. The distinct causes:

  • The grace period expired and no license server is configured at all.
  • A license server is configured but not activated, or holds no CALs for this deployment.
  • The CALs are too old for the session host. Later CALs serve earlier hosts, never the other way round: Windows Server 2022 CALs work on 2022, 2019 and 2016 hosts, and are refused by a 2025 host.
  • The deployment is a workgroup and someone chose Per User. Per User CALs can't be tracked within a workgroup and aren't permitted there; workgroup deployments have to use Per Device.
  • The license server is configured and healthy but unreachable — RPC ports blocked, or the Remote Desktop Licensing service stopped.

Ask the session host what it thinks its licensing is

Two commands settle which cause you have. Win32_TerminalServiceSetting lives in the Root\CIMv2\TerminalServices namespace, and its GetGracePeriodDays method documents that a zero value means the grace period is over:

$ts = Get-CimInstance -Namespace root/cimv2/TerminalServices -ClassName Win32_TerminalServiceSetting
$ts | Select-Object ServerName, TerminalServerMode, LicensingType, PolicySourceLicensingType
Invoke-CimMethod -InputObject $ts -MethodName GetGracePeriodDays
Invoke-CimMethod -InputObject $ts -MethodName GetSpecifiedLicenseServerList
ServerName                : RDSH01
TerminalServerMode        : 1
LicensingType             : 4
PolicySourceLicensingType : 0
 
DaysLeft ReturnValue
-------- -----------
       0           0
 
SpecifiedLSList ReturnValue
--------------- -----------
{}                        0

Read it against the documented values. TerminalServerMode 1 means the host runs as an application server, so CALs apply. LicensingType 4 is Not Configured (2 is Per Device, 3 is Per User). PolicySourceLicensingType 0 means the setting came from the server, 1 means Group Policy is deciding — worth knowing before you edit the wrong place. An empty SpecifiedLSList with DaysLeft 0 is the textbook case: grace over, nothing configured.

Point the deployment at an activated license server

If your deployment has an RD Connection Broker, set it there, either in Server Manager under Remote Desktop Services, Overview, Edit Deployment Properties, RD Licensing — or in one line:

Set-RDLicenseConfiguration -LicenseServer @("Rdl-1.Contoso.com","Rdl-2.Contoso.com") `
  -Mode PerUser -ConnectionBroker "Rdcb.Contoso.com" -Force

-Mode accepts PerDevice, PerUser and NotConfigured, and Get-RDLicenseConfiguration reads the current setting back.

For a host that only has the RD Session Host and RD Licensing roles, with no broker, the setting lives in policy: open gpedit.msc and go to Computer Configuration, Administrative Templates, Windows Components, Remote Desktop Services, Remote Desktop Session Host, Licensing. Enable Use the specified Remote Desktop license servers and enter the server names, separated by commas if there are several. Then enable Set the Remote Desktop licensing mode and pick Per Device or Per User. Before either step, confirm in RD Licensing Manager that the license server is activated and that its CAL counts are real — a green check beside the server name, with totals and available numbers that match what you bought.

Check the CAL version actually covers your session host

This one bites during upgrades, because nothing in the deployment looks misconfigured. A 2019 license server cannot hold 2022 or 2025 CALs, and a 2022 CAL cannot serve a 2025 session host. Install CALs on a license server running the same version of Windows Server as the CALs or later, and make sure the CAL version is at least the version of the host it has to serve. If you add a Windows Server 2025 session host to a farm licensed with 2022 CALs, that host alone will start refusing sessions while every older host keeps working.

When the configuration is right and the server is still unreachable

Between session host and license server, RD Licensing runs over RPC: TCP 135 for the endpoint mapper, plus the randomly allocated dynamic range TCP 49152–65535 on Windows Server 2008 and later, with TCP 445 and 139 for SMB and NetBIOS session traffic, and TCP/UDP 389 for LDAP when you use per-user CALs in Active Directory. Activation over the internet to the Microsoft Clearing House uses TCP 443.

Test-NetConnection -ComputerName Rdl-1.Contoso.com -Port 135
Get-Service -DisplayName "Remote Desktop Licensing" -ComputerName Rdl-1.Contoso.com
ComputerName     : Rdl-1.Contoso.com
RemoteAddress    : 10.20.4.11
RemotePort       : 135
TcpTestSucceeded : True
 
Status   Name               DisplayName
------   ----               -----------
Running  TermServLicensing  Remote Desktop Licensing

One more setting hides in this class of failure: the Access this computer from the network right, under Computer Configuration, Windows Settings, Security Settings, Local Policies, User Rights Assignment. If Everyone isn't assigned, assign it to Authenticated Users, Domain Computers, or the session host's computer account.

A worked example: day 121 on a Windows Server 2022 farm

A two-host farm was stood up for a pilot in May and quietly became production. On a Tuesday in September, every new connection fails with the licensing message while existing sessions keep running. The diagnoser reports the expired grace period with no license servers configured. GetGracePeriodDays returns DaysLeft 0, GetSpecifiedLicenseServerList returns an empty array, and LicensingType reads 4. The team already owned 2022 CALs from another project, so they activate the licensing role on the broker, install the CAL pack, confirm the green check in RD Licensing Manager, then run Set-RDLicenseConfiguration with -Mode PerUser and both license servers. Reconnecting users get in immediately. The follow-up matters as much: the farm's planned 2025 session host is put on hold until 2025 CALs are purchased, because the existing 2022 CALs cannot serve it.

Confirm CALs are being issued, and keep it that way

Re-run the diagnoser; it should list no problems. Re-run the WMI block and check LicensingType now reads 2 or 3 instead of 4, and that SpecifiedLSList contains your servers. Then watch RD Licensing Manager over the next few days — issued CAL counts should climb as people sign in. Per device CALs make this visible: the first connection from a device gets a temporary CAL valid for 90 days, and once the license server is activated with CALs available, that becomes a permanent CAL valid for a random 52 to 89 days, renewed when the session host sees it within seven days of expiry. Per user CALs are not enforced and can be over-allocated in breach of the licensing agreement, so track their number in Remote Desktop Licensing Manager rather than trusting that sign-ins keep working.

How this differs from the licensing-mode warning and the security-error variant

If users still connect but see a balloon reading Remote Desktop licensing mode is not configured. Remote Desktop Services will stop working because this computer is past its licensing grace period., you are early: the mode is unset, connections continue for now, and you have time to configure licensing properly rather than at 09:00 on a Monday. The other variant, Access was denied because of a security error., is usually not about CAL availability at all — it tends to be damaged licensing certificates. The documented repair is to back up and then remove the Certificate, X509 Certificate, X509 Certificate ID and X509 Certificate2 values under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM, restart the computer, and reactivate the license server. Export the key first; that instruction is in the support article for a reason.

Next time sessions stop at the licensing message, walk these checks back in order: what the diagnoser says, what GetGracePeriodDays and GetSpecifiedLicenseServerList return, whether the license server is activated with CALs new enough for the host, and only then go looking at the network.

Related questions

Can the 120-day grace period be extended or reset?

Treat it as a one-time allowance. Microsoft documents a licensing grace period of 120 days during which no license server is required, and states that once the grace period ends, clients must have a valid RDS CAL issued by a license server before they can sign in to a remote session. There is no supported way to extend it. The supported path is to activate an RD Licensing server and install CALs, which is also the only path that keeps you inside the licensing terms.

We only use the two administrative sessions. Do we need CALs?

Check what mode the host is actually in before assuming. In the WMI output, TerminalServerMode 0 is RemoteAdmin and 1 is AppServer, and LicensingType 1 is Remote Desktop for Administration while 2 and 3 are the Per Device and Per User application-server modes. A server that had the RD Session Host role installed is an application server, and that is exactly the case where the grace period expires and sessions start being refused.

Can we use Per User CALs on workgroup servers?

No. Per user CALs are assigned to a user in Active Directory and can't be tracked within a workgroup, so they aren't permitted in a workgroup deployment. Use Per Device CALs there, which are assigned to the device and tracked by the license server regardless of Active Directory membership. In a domain-joined deployment you can use either type.

The license server has CALs installed but the host still refuses sessions.

Check the version pairing next. A CAL can serve session hosts of its own version or older, never newer, and CALs must be installed on a license server running the same Windows Server version or later. Windows Server 2022 CALs on a 2022 license server cannot license a 2025 session host, and 2025 CALs cannot be installed on a 2022 license server. The RD Licensing Diagnoser reports this as a licensing problem rather than a connectivity one.

Why do per device CALs expire on strange dates?

By design, so renewals spread out instead of arriving together. A temporary per device CAL is issued on first sign-in and is valid for 90 days; a permanent one is valid for a random period of 52 to 89 days, and the session host renews it with the license server once the expiry date is within seven days. Per user CALs behave differently: they show as expiring 60 days after issue and are extended at the next sign-in.

References

Haneul Seo

Infrastructure engineer · 10+ years running Linux fleets

More in this category

Start request repeated too quicklyFixed

systemd: Start request repeated too quickly

systemd refuses to start a unit that was started more than StartLimitBurst times (default 5) within StartLimitIntervalSec (default 10s), and Restart= counts against that limit. With the 100 ms default RestartSec a crashing service burns all five attempts in under a second. Find the real crash in the journal, fix it, run reset-failed, and give restarts room with RestartSec.

systemd
Too many authentication failuresFixed

SSH: Received disconnect ... Too many authentication failures

Your agent is offering more keys than the server will let you try. Every public key sshd looks at burns one of the MaxAuthTries attempts — six by default, often three on a hardened host — so the right key never gets its turn and the server hangs up before you type anything. IdentitiesOnly=yes with an explicit IdentityFile pins the connection to one key and the attempt count drops to one.

OpenSSH
1722Fixed

Active Directory: replication fails with error 1722, The RPC server is unavailable

RPC reports 1722 (0x6ba, RPC_S_SERVER_UNAVAILABLE) when a lower layer fails to connect, so the real fault is almost never RPC itself — it is DNS, a blocked port, or a host-side setting on one of the two domain controllers. repadmin tells you which partner is failing, dcdiag /test:dns rules out name resolution, and Test-NetConnection plus the dynamic port range settle the firewall question. The most common miss is a rule that allows TCP 135 but not 49152–65535.

Windows Server Active Directory
0x80070035 / Event ID 31017Workaround

Windows 11: "Your organization's security policies block unauthenticated guest access" when opening a NAS share (0x80070035)

The SMB client on Windows 10 Enterprise/Education/Pro for Workstations, Windows 11 Pro and Windows Server 2019+ refuses guest logons by default, and Windows 11 24H2 Enterprise/Pro/Education also requires SMB signing, which guest sessions can't do. A NAS share that only offers guest access therefore fails with the 'block unauthenticated guest access' dialog, Error code 0x80070035, or System error 3227320323, and Event ID 31017 'Rejected an insecure guest logon' lands in the SmbClient/Security log. The fix Microsoft recommends is a real account on the NAS and signing support in its firmware; Set-SmbClientConfiguration -EnableInsecureGuestLogons $true (plus -RequireSecuritySignature $false on 24H2) is the escape hatch, and it costs you signing and encryption on that client.

Windows (SMB client)
E: Could not get lock /var/lib/dpkg/lock-frontendFixed

Ubuntu/Debian: E: Could not get lock /var/lib/dpkg/lock-frontend — who holds it and how to wait for it

Another package manager, usually Ubuntu's unattended-upgrades fired by a persistent systemd timer at boot, holds the dpkg frontend lock while your apt-get runs. apt-get gives up at once while apt waits because Ubuntu ships binary::apt::DPkg::Lock::Timeout "120" for the apt binary only. Read the PID from the message, let the run finish or pass -o DPkg::Lock::Timeout=<seconds> to apt-get, run dpkg --configure -a only after a genuinely interrupted run, and never delete the lock file: it is an fcntl lock the kernel releases when the holder exits.

APT (Ubuntu/Debian)
xcrun: error: invalid active developer pathFixed

macOS: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)

git, make, clang and other /usr/bin developer commands on macOS are shims that hand off to the active developer directory, and xcrun is reporting that the directory xcode-select points at has no tools in it — most often because a major macOS upgrade left /Library/Developer/CommandLineTools empty, or Xcode was moved or deleted. Check xcode-select -p and the package receipt, then reinstall the Command Line Tools with xcode-select --install, or point xcode-select at the Xcode you actually have.

macOS