NAV 2017 not documented options for “Credential Type”


In NAV 2017 there are two new options for “Credentials Type”: TaskScheduler and EchangeIdentity.

“Credential Type” -> “AS IS” Documentation
“Specifies the authentication mechanism for Microsoft Dynamics NAV users of this Microsoft Dynamics NAV Server instance.”
The options are “Windows, Username, NavUserPassword, and AccessControlService”.

But… What about others features ?  “TaskScheduler”, “EchangeIdentity”, “None” ?

In reality now there are three not documented options in the online help and also in NAV admin console help: “TaskScheduler”, “EchangeIdentity”, “None”   …the option “None” was already existing in 2016, undocumented.

NAV 2016

nav-2016-1

NAV 2017

nav-2017-2

nav-2017-3

I asked Microsoft to update the documentation on MSDN (not updated from NAV 2016), useful in explaining exactly the “scope” and the “ByDesign” concept of each option.  I’ll let you know!  .

I have the solution (23/03/2017..) !.. Thanks to Microsoft…  -> “These options are for Dynamics 365 for Financials” .. IASS applications !!!  .not for NAV.

MSDN – “Users and Credential Types”
https://msdn.microsoft.com/en-us/dynamics-nav/users-and-credential-types

 

Some old posts

I have already talked about the new task scheduler and new NAV Admin console options previously, below some links that can be useful.

NAV 2017 “Task Scheduler”
https://robertostefanettinavblog.com/2016/11/04/nav-2017-task-scheduler/

NAV 2017 – What’s new in the Administration Console
http://www.pakiki.info/2016/11/01/nav-2017-whats-new-in-the-administration-console/

How to force specific service instance in Task Scheduler in NAV 2017?
http://forum.mibuso.com/discussion/68576/how-to-force-specific-service-instance-in-task-scheduler-in-nav-2017

Advertisements

“ALL ABOUT” Kill (In)active Sessions when “no more licenses”


Sometimes it happens that there are “no more licenses available” for Dynamics NAV, from NAV 2013 R2 and next releases, it’s necessary to run the Windows Client or to use Powershell statements to kill some sessions and unlock others.
If you are unable to access to NAV (“no more licenses”), you should need to use SQL Console and kill sessions from there (reading from Active Sessions Table of from sysprocesses View on master db..)
“Some user don’t want to use SQL Server to achieve this !” …
WARNING : “No more licenses !!”   … Immediately Buy Others !!!
license1.png
There are many ways to kill sessions, i list below some methods.
With NAV Server Login
– C/AL
– Powershell
Without NAV Server Login
– SQL Server Stored Procedures\T-Sql
– VB .NET Application
Below some methods to kill the sessions even in the case of “no more licenses available“: SQL Script and VB.NET
C/AL Statement to Kill Sessions
The Standard Statement for C/AL Code is:  STOPSESSION(“Session ID”);
Example:
IF CONFIRM (‘Kill Session ?’) THEN STOPSESSION(“Session ID”) … GOAL !
…. BUT YOU NEED TO CONNECT TO NAV SERVER !  .. sometimes is NOT possible!
———————————————————-
My VB.NET Solution
“I wrote a simple solution on VB.NET to Kill Active Sessions using a SQL Connections,
you cand find it on GITHUB and TECHNET.”
ON GITHUB
ON TECHNET
Post link
Download link
About My VB.NET Simple Solution, some pictures
kill1
kill-2
kill-3
App Config File
<?xml version=”1.0″ encoding=”utf-8″ ?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name=”NAV_2017_KIll_SQL_Inactive_Sessions.My.MySettings.Demo_Database_NAV__10_0_ConnectionString”
connectionString=”Data Source=STEFANETTILEN\SQL2012ENT;Initial Catalog=&quot;Demo Database NAV (10-0)&quot;;Integrated Security=True”
providerName=”System.Data.SqlClient” />
</connectionStrings>
<startup>
<supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.5″ />
</startup>
</configuration>
———————————————————-
SQL KILL STATEMENTS
KILL (Transact-SQL)
– Syntax for SQL Server, Syntax for Azure SQL Data Warehouse and Parallel Data Warehouse

KILL ‘session_id’ [;]    
Source https://msdn.microsoft.com/it-it/library/ms173730.aspx

KEEP IN MIND !!!   DON’T KILL PROCESSES IN THIS STATES:
-AWAITING COMMAND
-CHECKPOINT SLEEP
-LAZY WRITER
-LOCK MONITOR
-SIGNAL HANDLER
My Customized release
1) SP_SQL_KillNavServerSession
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
— =============================================
— Description: KILL ALL NAV ACTIVE USER SESSSIONS WITH MULTIPLE INSTANCES
— =============================================
CREATE PROCEDURE [dbo].[SP_SQL_KillNavServerSession]
AS
BEGIN
DECLARE @RowIndex AS INT;
DECLARE @MaxIndex AS INT;
 SET @RowIndex = 1;
SELECT @MaxIndex =
(SELECT top 1 MIN([Session ID])
FROM [ITA].[dbo].[Active Session]
WHERE [User ID] = ‘************’
group by [Session ID])
 — Remove Active Session
DELETE FROM [DB].[dbo].[Active Session] where [Session ID]>@MaxIndex AND [User ID] = ‘*********’
END
2) SP_SQL_KillNONavSession
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
— =============================================
— Description: KILL SLEEPING NO NAV SESSIONS
— =============================================
CREATE PROCEDURE [dbo].[SP_SQL_KillNoNavSession]
AS
BEGIN
DECLARE @Session TABLE
(
id INT IDENTITY(1,1) PRIMARY KEY,
[sid] int,
ltime DATETIME,
hname varchar(MAX),
uid varchar(100),
lret datetime,
etime int
);
DECLARE @NotAffectedUserList TABLE
(
id INT IDENTITY(1,1) PRIMARY KEY,
[uid] varchar(MAX)
);
DECLARE @session_time as int;
DECLARE @vSID as int;
DECLARE @command as varchar(MAX);
DECLARE @RowIndex AS INT;
DECLARE @MaxIndex AS INT;
set @session_time=15; — Assign Session time in Minutes
— Assign List of Users who “will not be affected” by this Session Kill
INSERT into @NotAffectedUserList SELECT ‘sa’
INSERT into @NotAffectedUserList SELECT ‘NT AUTHORITY\SERVIZIO DI RETE’
INSERT into @NotAffectedUserList SELECT ‘**************’
INSERT into @NotAffectedUserList SELECT ‘scheduler’
INSERT into @Session
SELECT
session_id as [Session ID],
login_time as [Login Time],
host_name as [Host Name],
LOGIN_NAME as [Login ID],
last_request_end_time as [Last Request End Time],
DATEDIFF(minute,  last_request_end_time,getdate()) as[Elapsed Time (minutes)]
FROM
sys.dm_exec_sessions
WHERE
open_transaction_count = 0
AND host_name <> ‘NAVSRV’ COLLATE Latin1_General_CI_AS
AND host_name is not NULL
AND DATEDIFF(minute,  last_request_end_time,getdate())>=@session_time
–AND client_version=4
AND login_name COLLATE Latin1_General_CI_AS not in
(
SELECT DISTINCT uid
FROM @NotAffectedUserList
)
SET @RowIndex = 1;
SELECT @MaxIndex = MAX(id) FROM @Session;
WHILE( @RowIndex <= @MaxIndex)
BEGIN
SELECT @vSID = sid
FROM @Session
WHERE id = @RowIndex;
 — String together the KILL statement
SELECT @command = ‘KILL ‘ + CAST(@vSID AS varchar(5))
 BEGIN TRY
  — Execute the final string to KILL the spids
EXEC (@command)
END TRY
BEGIN CATCH
declare @emsg varchar(500);
SELECT
@emsg=ERROR_MESSAGE();
  print @emsg;
END CATCH
 SET @RowIndex = @RowIndex + 1;
END;
END
// KILL SQL INACTIVE SESSIONS FOR NAV APPLICATIONS
// ONLY FOR SLEEPING SESSIONS – OLD NAV CLIENTS
a very Simple SQL Stored Procedure to ‘kill’ sql inactive sessions
idle (sleeping) for 10 minutes related to “Nav Client” applications
*** it’s necessary to identify correct “application name” ***
*** ex: program_name LIKE N’%NAV client% *** or %NAV Web%
DECLARE @v_spid INT
DECLARE c_Users CURSOR
FAST_FORWARD FOR
SELECT SPID
FROM master..sysprocesses (NOLOCK)
WHERE spid>50
AND loginame <> ‘DIR%’
AND program_name LIKE N’%NAV client%’
AND status=’sleeping’
AND DATEDIFF(mi,last_batch,GETDATE())>=10
AND spid <> @@spid
OPEN c_Users
FETCH NEXT FROM c_Users INTO @v_spid
WHILE (@@FETCH_STATUS=0)
BEGIN
PRINT ‘Killing ‘+ CONVERT(VARCHAR,@v_spid)+’…’
EXEC(‘KILL ‘+ @v_spid)
FETCH NEXT FROM c_Users INTO @v_spid
END
CLOSE c_Users
DEALLOCATE c_Users
———————————————————-
OTHERS NICE SOLUTIONS (NAV LOGIN IS REQUIRED)
Olof Simren Solution
Kill Sessions in Dynamics NAV (from NAV Page)
Source https://www.olofsimren.com/kill-sessions-in-dynamics-nav/
Gunnar Solutions
ADO NET Solution
Kill Idle Connections
Source http://www.dynamics.is/?p=471
Poweshell Solution
Stopping Idle Microsoft Dynamics NAV Services
Nice Sessions Killing !

How To setup “Keep Alive Interval” setting NAV2016-NAV2017


Many posts in forums about this topic; some people report that Idle Client Timeout configured in NAV Administration is not working.
Example of scenario: “Users logs in to the Navision by windows client installed on their PC but after setting idle client timeout session for 3 minutes then also it does not log off after 30 minutes also.”
or
Automatically Idle Client Timeout – NAV2016 – doesn’t work!
http://forum.mibuso.com/discussion/66081/automatically-idle-client-timeout-nav2016-doesnt-work

History of ClientKeepAlive setting
Since the October 2015 cumulative updates, the Dynamics NAV Windows client timeout configuration was managed at the service level by setting the Idle Client Timeout setting.

“The October 2015 cumulative updates added a new setting: “ClientKeepAlive”.
This  setting is managed at the user level and located in the ClientUserSettings.config file.

The value of this setting is given in seconds and defines the interval between ‘pulse’ signals sent by the client to prevent the client from going idle in some scenarios, or for some users.

ClientKeepAlive: about this setting

  1. In the server configuration file, set Idle Client Timeout  to 00:10:00
  2. In the client configuration file, set ClientKeepAlive  to any value  larger than 600
    This value is in seconds, so 600 equals 10 minutes.

Microsoft, by popular demand, changed in Dynamics NAV 2016 Cumulative Update 8:
The ClientKeepAlive setting has been moved from the user level to the service level: “Keep Alive Interval “, and is no longer defined in number of seconds but as a time interval, just like the Idle Client Timeout setting.”

Keep Alive Interval : about this setting

So following our example above, to configure a timeout interval for the Dynamics NAV Windows client to 10 minutes, in Dynamics NAV 2016 Cumulative Update 8 and later, you must set the following:

  1. In the server configuration file, set Idle Client Timeout  to 00:10:00
  2. In the server configuration file, set Keep Alive Interval  to a value larger than 00:10:00

PS: If you are running on a NAV 2016 build earlier then CU 8, your clientkeepalive settings will still be located Client side, in ClientUserSettings.config

Web Client
“To configure the timeout for the Dynamics NAV Web client, it is sufficient to configure the SessionTimeout setting in the web.config file to the relevant interval – in our example it’s 00:10:00.”

PS: Check your NAV Release and build for correct configuration!

Sources:
Configuring Client Timeout
https://blogs.msdn.microsoft.com/nav/2016/06/24/configuring-client-timeout/

Understanding Session Timeouts NAV 2016-NAV 2017
https://msdn.microsoft.com/en-us/library/dn789725(v=nav.90)

“ALL About” How To Boost Dynamics NAV Server


Hi Guys,
another post of “ALL About” Series, in this case, some people have asked me about NAV configuration and how to configure NAV Server for better performance (Boosting
NAV..);  also in Microsoft Forum there are several posts about this topic, i searched and collected a variety of useful information for a correct NAV Server configuration.
Documents and Posts
“Great White Paper” about typical questions around the number of users or tenants, hardware requirements, scaling, and upgrading
-> “…How to have a great configuration and “How-to Boost NAV”!!
“This white paper provides detailed insight into the concepts and principles that support performance testing in Microsoft Dynamics NAV”.
By outlining some sample goals from the start, it explains how you can use load testing to optimize your application and hardware to meet the customer and user requirements – addressing typical questions around the number of users or tenants, hardware requirements, scaling, and upgrading”
Below some useful information about NAV Server Configuration.
NAV Server Configuration Best Practices (from Whitepaper)
1) Number of Microsoft Dynamics NAV Service Tiers
When a client connects to Microsoft Dynamics NAV Server, the load balancer will select a server and keep the connection open throughout the lifetime of the client.
This means that setting up more servers behind a load balancer will increase the capacity of the cluster of Microsoft Dynamics NAV Service tiers.
2) Server Memory
Each Microsoft Dynamics NAV Service tier needs 500Mb of memory to run.
On top of that, the Microsoft Dynamics NAV Service tier needs memory for each active session, even if they are idle.
The more pages the user have opened, the more memory gets allocated, but a good starting point for doing sizing calculations is around 10Mb per active session.
Idle sessions are not terminated if they are running the Windows client.
Server CPU (cores and speed) Faster CPU will get things done faster, and more cores can run more things in parallel.
Idle sessions on the Microsoft Dynamics NAV Service tier don’t use any CPU power, except for generic housekeeping, which shouldn’t be counted.
3) Server CPU (cores and speed)
Faster CPU will get things done faster, and more cores can run more things in parallel.
Idle sessions on the Microsoft Dynamics NAV Service tier don’t use any CPU power, except for generic housekeeping, which shouldn’t be counted.
Active sessions will use CPU power depending on what they do, but it is hard to generalize how much.
For example, CPU power is used whenever the user is performing a task that requires the Microsoft Dynamics NAV Service tier to run some business logic or perform some UI logic or setup server pages.
If the Microsoft Dynamics NAV Service tier does a lot of IO (SQL calls or client callbacks), then the CPU will be waiting for response and thus be loaded less.
4) Data Cache Size
This is a Microsoft Dynamics NAV Server setting, which located in CustomSettings.config file. Sets the data cache size. This is an abstract value with contextual meaning on the type of the item being cached.
<add key=”DataCacheSize” value=”9″ />
The number you specify in DataCacheSize setting determines how much memory is used for caching data.
The actual amount of memory (in MB) allocated is 2n, where n is the value of the DataCacheSize setting:
Value Memor y 9 (default) 512Mb 10 1Gb 11 2Gb 12 4Gb 13 8Gb 14 16Gb 15 32Gb …
When running a single tenant system the default value of 9 is probably good.
When running a multi-tenant system, the data cache is shared between all tenants.
Set to 0 to disable cache.
boost2
5) Metadata Provider Cache Size
This is a Microsoft Dynamics NAV Server setting, which located in CustomSettings.config file.
Sets the Metadata Provider cache size (in number in objects cached).
Set to 0 to disable cache.
<add key=”MetadataProviderCacheSize” value=”150″ />
You can monitor the number of objects in the metadata cache by monitoring the following performance counter on the Microsoft Dynamics NAV Service tier.
There is really NO REASON not to set this to a high value (like 10000) if you are not pressed on memory on the Microsoft Dynamics NAV Server.
6) Max Concurrent Calls
This is a Microsoft Dynamics NAV Server setting, which is located in CustomSettings.config file.
Maximum number of concurrent client calls that can be active on the Microsoft Dynamics NAV Server.
To disable this setting set the value to “MaxValue”.
<add key=”MaxConcurrentCalls” value=”40″ />
The number specified here determines how many concurrent calls the Service Tier is able to handle. The more cores in your server, the higher this value can be.
NAVPERF (On Github)
GitHub organization for performance testing Microsoft Dynamics NAV
GitHub You will find a couple of projects on GitHub, which contains some sample code on how to do performance tests.
The GitHub organization is used to store the sample repositories and is available here:
boost1
boost3
nav-2017-sanmple

Microsoft Dynamics NAV 2017 Load Test sample as references from the Load Test WhitePaper

Enables you to create scenario tests for Microsoft Dynamics NAV.

The solution consists of:

Microsoft.Dynamics.Nav.LoadTest : A sample test for NAV Order Processor Scenarios Microsoft.Dynamics.Nav.TestUtilities : Test utilities to help build test scenarios Microsoft.Dynamics.Nav.UserSession : Client Library for the NAV Client Services Web Service

On the Microsoft Dynamics NAV 2017 DVD, you will find a folder called Test Assemblies. This folder contains one DLL, which is needed for running Load Tests: Microsoft.Dynamics.Framework.UI.Client.dll  The DLL is also included in this project.

Others nice links
Optimizing SQL Server Performance with Microsoft Dynamics NAV
https://msdn.microsoft.com/en-us/dynamics-nav/optimizing-sql-server-performance-with-microsoft-dynamics-nav
Videos
How Do I: Run NAV Performance Tests Using Visual Studio in Microsoft Dynamics NAV
https://www.youtube.com/watch?v=IG-y8DsXqaQ
Some my old posts here:
Monitoring Microsoft Dynamics NAV 2015 Server Using “Performance Counters”
https://robertostefanettinavblog.wordpress.com/2015/07/06/monitoring-microsoft-dynamics-nav-2015-server-using-performance-counters/