Does anyone have a SQL script to kill inactive web session in Dynamics GP 2015? I'd like to have a script running on schedule to clean up sessions that have been inactive for 2+ hours.
Thanks
Joe
*This post is locked for comments
The process is very messy but once you get the timeout set in config file then you must create a custom script to cleanup the GP Activity. I have timeout set at 1Hr then followup with GP activity cleanup every hour. Just a note the user that runs the web client session service must have local admin rights to kill sessions or it will appear nothing is working. Also consider the timeout setting in the config file literally. For example 60 minutes is not a legitimate parameter you must use 1 hr because at 59.59 it increments to 1hr and again would never appear to work :)
I find this process works well for us because the web client is only for employee self services and cannot cause damage with critical processes. This however is not supported by Microsoft and you must consider your specific requirements. In other words use at your own risk. We have several hundred web client users however and this works well for us.
Basically how this works is after the web client kills the session the status is set to 0. If you have a status of 0 and a record in the activity tables it is worthless so can be removed.
This is not a perfect solution but for today I think it is as good as exists.
delete t1
from DYNAMICS..ACTIVITY t1
join tmi..upr00100 t2 on t2.userid = t1.USERID
join tmi..SY01200 t3 on t3.master_id = t2.employid
where t1.ClientType = 2
and t3.inet1 not in (SELECT [ProcessUserName] COLLATE Latin1_General_CI_AI FROM [GPCONFIGURATION].[dbo].[SessionStatus] where status = 0)
delete tempdb..DEX_SESSION
where session_id not in (select SQLSESID from DYNAMICS..ACTIVITY)
delete tempdb..DEX_LOCK
where session_id not in (select SQLSESID from DYNAMICS..ACTIVITY)
I'm trying to find the thread that included a response from one MS support engineer, but can't seem to find it right now.. Have you looked at those threads ? :
https://community.dynamics.com/gp/f/32/p/151405/348412#348412
http://mohdaoud.blogspot.com/2014/12/dynamics-gp-web-client-kill-all-web.html
PS: just found the thread about the web-client inactivity.. however it is on the GPUG forum, not sure if it requires a valid login to read it : https://www.gpug.com/communities/community-home/digestviewer/viewthread?MessageKey=b9897fa6-a7d1-4973-8f99-dce8fb8b660d&CommunityKey=4754a624-39c5-4458-8105-02b65a7e929e&tab=digestviewer#bm0
Do you know how to adjust the timeout in web management console?
Hi Joe,
I think this question had come up quite a few times in the forum... and basically there is no such script that you can run.. as Microsoft strongly advises against such a procedure.
The inactive web client sessions are taken care by itself thru a timeout that is configured in the Web console management if not mistaken. Would have to look that up, as we don't use the web client at all.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,113 Super User 2024 Season 2
Martin Dráb 229,918 Most Valuable Professional
nmaenpaa 101,156