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
0
Answers
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.
I only have to get the distinct user to count the used license sessions.
thanks