Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

How to get the session an count the licenses available

$
0
0
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

Viewing all articles
Browse latest Browse all 10032

Trending Articles