NAV 2013 R2 and later - Session vs License count.

SteveKnottSteveKnott Member Posts: 43
edited 2015-05-11 in NAV Three Tier
Hi All,

Does anyone know how I can check the license usage on NAV 2013R2 service. We have multiple service tiers , and we have some issues with certain users getting license issues.

When we check the "Active Session" table, it seems to be less sessions than the license . Job Queue is running - so its possible that some jobs are taking sessions at the exact time etc.

My question is how do I count the [Active Session] table to get "licenses used" ?

Read this... ... -counting/ and makes sense...but I want to find out the count of licenses used rather:

I am "guessing" that it may be 1 per user per client type per client host name ? or is it per username ?

Also.. is there a counter that we can query somehow ? Looked in perfmon.... I can see active session... but that mathces the [Active Session] table... and can have more than the license count.

Any tips would be appreciated.



  • RemkoDRemkoD Member Posts: 100
    edited 2016-11-14
    Unfortunately you cannot view the current consumed licenses in NAV anymore (since 2013). I've performed a few tests on this with a colleague of mine and it seems easier then it seems.

    Client types that do not consume licenses
    A few client types do not consume licenses (anymore). For instance the service account starting a NST does not consume a license for it's own session. Neither for NAS services, even if the NAS is executing jobs from the jobqueue. Background processes do not consume licenses too. You get the idea.

    Client types that do consume licenses
    A few client types do consume licenses. For instance the Windows RTC, Web RTC, Tablet client, SOAP/ODATA calls, etc. A license will be consumed if an unique user makes a connection with NAV with one of the above client types. If this user on the other hand makes another connection with NAV with the same or an other client type, this won't consume another license. NAV counts unique users.

    For example if one user starts an session with a windows RTC client from a desktop machine, a session from his tablet with the app and start a job manually (creates a background process) the user will still consume 1 license.

    What i do not understand from your post is that you say that you see less sessions in the active session overview than licenses available in the license and that you've issues with it... that is something I haven't seen before.

    Query to view current consumed licenses
    With the following query you can view the current consumed licenses. I'm not sure if it's waterproof, I just wrote it and did not test it. Feedback is welcome.

    Current consumed licenses NAV 2016

    Client Types:
    0 = Windows RTC
    1 = Sharepoint Client
    2 = Webservices (SOAP & ODATA)
    3 = Client Service
    4 = NAV application service (NAS)
    5 = Background
    6 = Management Client
    7 = Web RTC
    8 = Unknown
    9 = Tablet RTC
    10 = Desktop RTC

    SELECT COUNT(DISTINCT [User ID]) AS 'Current consumed licenses'
    FROM [dbo].[Active Session]
    WHERE [Client Type] IN (0,1,2,7,9,10)
  • lucostalucosta Member Posts: 5
    I'm using Multi-tenancy soo it will be more complicated.
    I'm using powersheel, but I don't have 100% sure if its correct.
    the $countType

    $tenants = Get-NAVTenant -ServerInstance dynamicsnav90

    $counters = New-Object System.Collections.Hashtable
    $countType = New-Object System.Collections.Hashtable
    foreach ($tenant in $tenants)
    $sessions =Get-NAVServerSession -ServerInstance dynamicsnav90 -Tenant $tenant.Id
    foreach ($session in $sessions)
    Write-Host ("{0}`t{1}`t{2}" -f $tenant.Id,$session.UserID,$session.ClientType)

    Write-Host ("Total Sessions`t {0}" -f $totalSessions )
    $counters| Format-Table
    $countType | Format-Table
  • xStepaxStepa Member Posts: 106
    edited 2017-03-05
    Hi, and what about the Full/Limited user? How to determine that from the session count?
  • RemkoDRemkoD Member Posts: 100
    edited 2018-02-28
    With SQL it would look something like this:
      'Microsoft Dynamics NAV Full User License consumed' = (SELECT
        COUNT([License Type])
    	FROM [dbo].[User]
    	WHERE [License Type] = 0
    	AND [User Security ID] IN (SELECT DISTINCT
    		[User SID]
    		FROM [dbo].[Active Session]
    		WHERE [Client Type] IN (0, 1, 2, 7, 9, 10))),
      'Microsoft Dynamics NAV Limited User License consumed' = (SELECT
        COUNT([License Type])
    	FROM [dbo].[User]
    	WHERE [License Type] = 1
    	AND [User Security ID] IN (SELECT DISTINCT
    		[User SID] 
    		FROM [dbo].[Active Session]
    		WHERE [Client Type] IN (0, 1, 2, 7, 9, 10)))

    Note that if the amount of consumed limited user licenses exceeds the amount of limited users in your NAV license, then you have to subtract the difference from the limited user count and add it to the full user count.

    I haven't tested the query thoroughly, so feedback from anyone using this is welcome.
Sign In or Register to comment.