Total Pageviews

Tuesday, December 23, 2014

Terminal Server Licensing Model and Workflow

                     Terminal Server Licensing Model and Workflow

Terminal Services provides the ability to host multiple, simultaneous client sessions on Windows Server. A client access licensed is issued to every type of client that will access the Windows Server 2003 Terminal Services (From now Terminal Services will be referred as TS).
There are 2 types of TS Licensing:
·                                               Per Device Licensing
·                                                Per User Licensing

Per Device Licensing Model:

If your infrastructure is configured with Per Device License for a Terminal server, below are the 3 scenarios where a client connection gets validated.
     
           User (X) connecting to an application hosted on a TS server for the First time from his device (M):
Since the user is trying to establish the TS session for the very first time, the client device will not have the locally installed TS cals. However, the terminal server still accepts the connection and sends the same request to TS License server.
For all the scenarios, let’s assume TS Licensing server is up and running fine and responding to all the requests from TS server.
Since, the user is launching the hosted application for the very first time from that device, the TS license server issues a 90 day Temp cal for that particular device. Thus session initialization continues and the user has successfully bi-passed the TS Licensing channel for the first time from that device with a temp cal stored under the client registry key:   HKLM\Software\Microsoft\MSLicensing.
2   
            User(X or Y2 or Z3) connecting to an application hosted on a TS server for the from the same             device(M)
In this scenario the condition is, user who tries to establish the TS connection can be either same or different user. But, the client device is already used to establish the TS session for 1 time and already has a Temp cal installed for a period of 90 days.
When the TS server identifies that the incoming client connection has already a 90 day Temp cal installed, it sends the request to TS Licensing server. Now, the TS License server must grant a new Permanent License to the Client device.
License server picks any random expiration date between 52 to 89 days from the requested time.
The details of the expiration dates of TS client cals are recorded in licensing databases. Once this is completed, the available TS cals gets decremented by 1 in the License store. Later, the TS Licensing server transmits the TS Licensing cals from TS server to the client Device(M) which again stores under the client registry key: HKLM\Software\Microsoft\MSLicensing.
3
                         User(X or Y2 or Z3) connecting to an application hosted on a TS server from the same device(M)        for N+2nd time.
In this scenario the condition is, user who tries to establish the TS connection can be either same or different user. But, the client device is already used to establish the TS session for N+2 times and already has a permanent License with the random expiration between 52 to 89 days.
·         If the client cal expiry period is greater than 7 days, session initialization continues and the user has successfully bi-passed the TS Licensing channel.
·         If the client cal expiry period is lesser than 7 days, the terminal server again attempts to contact the TS Licensing server to request the new permanent Licenses and the process repeats as described in Step2. 

Per User Licensing Model:
Per User Licensing model is simpler and easier as compared to Per Device Licensing.

      The user tries to attempt to launch an application hosted on a TS server. The TS server with per user configured then connects to TS License server. It then grants 1 license to that userID and decrements the license count by 1 in the License store and transmits back to the TS server and to the client computer for a successful session initialization.
2    Once the user logs off from the hosted application, the client license is added back to the License pool.
3    This is a concurrent user license, based on the number of simultaneous user connections.

What if TS License server is down?
·         In all the above scenarios we had considered the TS license server to be up and running fine and all the network communications between TS server and TS License server is as expected.
·         Now, let’s assume the License server is either down or there is a breakdown in the  network communications between TS server and TS License server
·         In all the cases, except for Per-device Licensing cal which has an expiration period of greater than 7 days, TS server will try to contact TS Licensing server.
·         If a Terminal Server cannot locate a license server, it will still allow unlicensed client devices to logon using the Grace period.
·         Grace period = 120 Days.
·         Definition of Grace periodà Grace period is the duration of time where First unlicensed client device tries to contact the TS server to a period of 120 days.  

What if TS Licenses are exhausted or license renewal is not done?
·         If the licenses are out of stock or if license renewal is not done, it will begin to grant a 90-day temporary license certificates to client devices.
·         There is no limit to the number of temporary licenses that a license server can grant.
·         This 90 day timer can be different for different clients. i.e. it is client specific. Different temporary licenses can expire on different days—even if they were all granted by the same license server.

TS Licensing Dashboard:
Terminal Services configuration settings on one of the TS server: