Find inactive user in NAV

I want to find out which users have not logged in NAV in the past 60 days. Is there a specific report or SQL script?

Thanks,

Wassim Minkara

Welcome to DUG!!!

Which version of Navision you are using ?

I am using NAV 5.0 SP1

Thanks,

Hi Wassim,

to check which users are logged in to the NAV-database and long long they are inactive you can run the following script:

You can use this script in a SQL-job and kill the sessions that are inactive for more than xxx minutes. Provided to use at your own risk

;WITH cte as

(SELECT

Db_name(dbid) AS DBName

,Isnull((SELECT TOP 1 'YES ’

FROM INFORMATION_SCHEMA.TABLES

WHERE TABLE_CATALOG = Db_name(dbid)

AND TABLE_NAME = ‘$ndo$dbproperty’), ‘’)

+Isnull((SELECT TOP 1 ‘IT IS’

FROM INFORMATION_SCHEMA.TABLES

WHERE TABLE_CATALOG = Db_name(dbid)

AND TABLE_NAME = ‘Object’), ‘’) AS NavDatabase

,loginame AS LoginName

,program_name

,login_time

,Datediff(mi, last_batch, Getdate()) InactiveMinutes

,spid

FROM

sys.sysprocesses

WHERE

dbid > 0

and open_tran=0)

SELECT

FROM

cte

WHERE

NavDatabase = ‘YES IT IS’

Thank you for the post. I am looking for inactive users–those who have access but have not logged in NAV within some timeframe (30-60 days). I want to find out who is not actively accessing NAV and revoke their access.

Wassim