
How to create a new Dynamics NAV User from PowerShell
Current Windows User must have admin permission to the SQL Server

There are instances where you may be asked to find an easy method for removing the idle users from the NAV database. There has been a well known method where you write a NAV report object to check the idle time of each user and delete the session id by checking their idle time.
There are instances where you may be asked to find an easy method for removing the idle users from the NAV database. There has been a well known method where you write a NAV report object to check the idle time of each user and delete the session id by checking their idle time. Then you schedule the NAV report through Navision Application server (NAS).
However, this is an alternative method; in this way, you write a SQL script and schedule it through SQL Job, in the same way you schedule your maintenance plans in your SQL Server such as making daily backups, truncating log files etc.
SQL Script :
USE MyDatabase
DECLARE @EXECSQL varchar(max)
SET @EXECSQL = ''select @EXECSQL = @EXECSQL+ 'Kill ' + Convert(varchar, [Connection ID]) + ';'
From Session WHERE [Application Name]='Microsoft Dynamics NAV Classic client' and [Idle Time]>3000
EXEC(@EXECSQL)
How to schedule the above SQL Script:
Just enable a job. It’s a matter of pasting the code and give the date & time etc. This is similar to Windows scheduler as well.
Steps for scheduling via a SQL Job:
1. Expand the SQL Server Agent node and right click the Jobs node in SQL Server Agent and select 'New Job'
Special Note: I just thought of posting this into the blog even for own future references. Thanks very much Isuru (Isuru Dias) for letting this to me.

Premanath Kumarage
Author

Current Windows User must have admin permission to the SQL Server

By default which database to connect is stored in a config file called ClientUserSettings.Config file.

Table locking is a normal but often confusing reality in any multi-user ERP system. In Microsoft Dynamics NAV, locking issues are especially common in manufacturing and service-based organisations, particularly during month-end processing.
Start here
A working session, not a sales call. Bring the process your current system fights you on, and we will tell you plainly what it would take to fix it.
Newsletter
Stay ahead with Microsoft Business Applications.
Insights, implementation advice and practical ideas to help your business get more from Microsoft technology.
By subscribing, you acknowledge MicroCloud 360’s Privacy Policy.