How to get the session an count the licenses available

lucostalucosta Member Posts: 5
edited 2017-01-12 in NAV Three Tier
Using a Dynamics Nav 2016 solution with multi-tenancy, we need to calculate the number of licenses we are currently using, to check wheither we have to buy more fulluser licenses or not.

I use PowerShell to get the tenants (foreach) and than I count the sessions and list the users.

but I'm getting an higher number of open sessions than It's supposed.
The user that are running the service are using 77% of the total open sessions.

PowerShell

cls
$tenants = Get-NAVTenant -ServerInstance dynamicsnav90

$totalSessions=0

foreach ($tenant in $tenants)
{
$s=0
#$obj = Get-NAVServerSession -ServerInstance dynamicsnav90 -Tenant $tenant.Id
$sessions =Get-NAVServerSession -ServerInstance dynamicsnav90 -Tenant $tenant.Id
foreach ($session in $sessions)
{
$s+=1
$totalSessions+=1
Write-Host ("{0}`t{1}`t{2}" -f $tenant.Id,$session.UserID,$session.IsReadOnly)
}


}
Write-Host ("Total Sessions`t {0}" -f $totalSessions )

Is this wrong or I have to exclude the service user or there is another way?

Thanks

Best Answer

  • lucostalucosta Member Posts: 5
    Answer ✓
    Active session on each tenant?... God... back to powershell.
    I only have to get the distinct user to count the used license sessions.
    thanks

Answers

  • krikikriki Member, Moderator Posts: 9,115
    [Topic moved from 'Navision Financials' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • zohaibu95@hotmail.comzohaibu95@hotmail.com Member Posts: 223
    You can see the table# 2000000110 (Active session). It has all the opened sessions.
    Best Regards
    Zohaib Ahmed
    Dynamics NAV ERP Technical Consultant.

    please like / agree / verify my answer, if it was helpful for you. thanks.
  • lucostalucosta Member Posts: 5
    Answer ✓
    Active session on each tenant?... God... back to powershell.
    I only have to get the distinct user to count the used license sessions.
    thanks
Sign In or Register to comment.