Automatically kill idle users

Hi,

I am using Microsoft dynamics Nav 2009 R2 in my company. Idle users have become to a headache for us.

Please tell me a way to kill them after a particular time period.

Many Thaks,

Thimira.

Hi Thimira

I hope you mean to kick the users off? I laughed a little when I read your post. I’m sorry I can’t be of help.

Later

Strawberry

Hi ,

Please search the forum prior to asking a question there are plenty of questions already posted around this issue.

ta,

g.

And welcome to DUG :slight_smile:

You need to mention which version of navision you are using …

Microsoft Dyamics Nav 2009 R2

Thanks a lot.

Hi,

:slight_smile:

Thanks

Thimira

it is a modification in the system. you can made a modification in dynamics NAV or write a SQL query on SQL.

EX: if user ideal for 10 minutes user session kill and licence will be added to the licence pool.

Hi,

Thanks a lot for the reply…

Would you please tell me how to do that modification in dynamics NAV??

Thanks

Hi

this is for SQL side

use this query.

use [master]
go
set statistics io off
set nocount on
go
declare @threshold datetime
set @threshold = dateadd(hour, -6, getdate()) – threshold is 6 hours ago
print 'Killing processes which executed “Last Batch” before ’ + convert(varchar(30), @threshold, 113)
print ‘’

declare @spid int, @last_batch datetime
declare spid_cur cursor for
select [spid], [last_batch] from sysprocesses
where ([program_name] = ‘Microsoft Business Solutions-Navision client’) OR ([program_name] = ‘Microsoft Dynamics NAV client’)
and [last_batch] <= @threshold
open spid_cur
fetch next from spid_cur into @spid, @last_batch
while @@fetch_status = 0 begin
print 'Killing process ’ + convert(varchar(5), @spid) + ', idle since ’ + convert(varchar(30), @last_batch, 113)
exec ('kill ’ + @spid)
fetch next from spid_cur into @spid, @last_batch
end
close spid_cur
deallocate spid_cur
go

This checks if the last batch (e.g. query) of a session was fired more than 6 hours ago (change threshold on demand) and would kill this “idle session”.

(The script needs to be adjusted according to your requirements, NAV version etc., add user-exclusions etc.)

NOTE: If it is in Dynamics NAV ,It is possible to do in NAV 2013 or later (Not NAV 2009)

Guys , this is not productive. Please use the search , this issue had been addressed before .

g.

Thimira,

Which client you are using ? RTC or Classic client ?

wow… he made me laugh too. [:D] … killing user is also one of the way to solve your issue. sorry for this [Y]