web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Kill inactive web sessions in Dynamics GP 2015

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,061 Moderator on at

    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.

  • Community Member Profile Picture
    on at

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

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,061 Moderator on at

    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

  • kdraper Profile Picture
    on at
  • kdraper Profile Picture
    on at

    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)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Shravan Attelli Profile Picture

Shravan Attelli 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans