Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

Kill inactive web sessions in Dynamics GP 2015

Posted on by Microsoft Employee

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

  • kdraper Profile Picture
    kdraper on at
    RE: Kill inactive web sessions in Dynamics GP 2015

    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)

  • kdraper Profile Picture
    kdraper on at
  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    RE: Kill inactive web sessions in Dynamics GP 2015

    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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Kill inactive web sessions in Dynamics GP 2015

    Do you know how to adjust the timeout in web management console?

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    RE: Kill inactive web sessions in Dynamics GP 2015

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,113 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans