Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Dynamics GP User Idle Time

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello

The article below provides a couple of scripts on how to check for GP User Idle time. I have seen a few of these on forums.

http://dynamicsgpblogster.blogspot.com.au/2009/04/retrieving-dynamics-gp-user-idle-time.html

However this was written in 2009 and since the release of GP2013 R2 'Check for User Messages' runs every minute. The idle time never goes over 60 seconds.

Is there either a way to 

- Disable 'Check for User Messages'. We don't really use this functionality.

-Another way to check for idle times

I have found these articles below written by Tim Wappat which describes using a Visual Studio Addin to auto log out users and the second linke 'part II' gets around this GP2013 R2 issue, but I don't know how to apply it to SQL.

http://www.timwappat.info/post/2013/08/25/Auto-Logout-for-Dynamics-GP

http://www.timwappat.info/post/2015/10/30/Inactivity-Auto-Logout-for-Dynamics-GP-part-II

Thanks

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics GP User Idle Time

    Thanks Sat but my post says this no longer works with GP2013 R2 due to 'Check for User Messages' functionality running every minute.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics GP User Idle Time

    Hi Tim

    Thanks a lot for your response.

    The question came about because specifically in the first few days of each month (processing EOM financials) we have started maxing out on licences. It is not really worth it for us to buy more for a coupe of days a month. It was more to be able to monitor which users are idle and get them to log out. Sending a system message to ask people to log out doesn't work if someone isn't actually look at GP. We tend not to use the feature and would be happy for it to be removed but it doesn't seem to be able to be done out of the box.

    I have SSMS knowledge, but not Visual Studio. Failing a SQL solution I was going to get an internal developer to have a look at your article as a second option, but they tend not to get involved much in GP and a solution I could manage would have been easier.

    Thanks

  • Tim Wappat Profile Picture
    Tim Wappat 5,703 on at
    RE: Dynamics GP User Idle Time

    Sat Kumar has kindly given us a script to demonstrate why scripts no longer work for this after 2013R2.

    :)

    Running on my production DB just now, you see that no one is more than a min of inactivity, going back to the original two posts above, this is because of the new timer in GP that will keep the connection active every minute. 

    Here is a post the explains the check user messages functionality. 

    http://www.timwappat.info/post/2015/02/18/Check-for-User-Messages(1)-Dynamics-GP-Process-Monitor

    sessions2.jpg

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Dynamics GP User Idle Time

    Try this one. You may convert it to minutes as well. Currenty it shows in hours -

    SELECT  RTRIM(A.USERID) AS UserID ,

           RTRIM(B.USERNAME) AS UserName ,

           RTRIM(C.INTERID) AS CompanyDatabase ,

           RTRIM(C.CMPNYNAM) AS CompanyName ,

           LOGINDAT AS LoginDate ,

           CONVERT(VARCHAR(1000), DATEPART(HH, LOGINTIM)) + ':'

           + CONVERT(VARCHAR(1000), DATEPART(MI, LOGINTIM)) AS LoginTime ,

           ISNULL(CONVERT(VARCHAR(1000),E.last_batch),'') AS SQL_LastBatch ,

           CASE WHEN D.session_id IS NULL

           THEN 'Corrupted Missing DEX_SESSION'

           ELSE CONVERT(VARCHAR(1000),session_id)

           END DEX_SESSION ,

           CASE WHEN CONVERT(VARCHAR(1000),E.SPID) IS NULL

           THEN 'Corrupted SQL_SESSION'

           ELSE CONVERT(VARCHAR(1000),SPID)

           END SQL_SESSION ,

           CASE WHEN DATEDIFF(mi, E.last_batch, GETDATE()) > 1

           THEN DATEDIFF(hh, E.last_batch, GETDATE())

           ELSE 0

           END AS 'IdleTime - InHours' ,

           CASE WHEN DATEDIFF(MI, LOGINDAT + LOGINTIM, GETDATE()) > 1

           THEN DATEDIFF(HH, LOGINDAT + LOGINTIM, GETDATE())

           ELSE 0

           END AS 'Logged in for – InHours'

           FROM    DYNAMICS..ACTIVITY A

           LEFT JOIN DYNAMICS..SY01400 B ON A.USERID = B.USERID

           LEFT JOIN DYNAMICS..SY01500 C ON A.CMPNYNAM = C.CMPNYNAM

           LEFT JOIN tempdb..DEX_SESSION D ON A.SQLSESID = D.session_id

           LEFT JOIN master..sysprocesses E ON D.sqlsvr_spid = E.spid

           AND ecid = 0        

           LEFT JOIN master..sysdatabases F ON E.dbid = F.dbid

  • Tim Wappat Profile Picture
    Tim Wappat 5,703 on at
    RE: Dynamics GP User Idle Time

    Hi Tania,

    If I read this correctly, you desire a script that will show you a list of users and the time since the last activity of that user, but have found the examples out there on the internet don't work anymore due to the internal GP timer firing continuously since new GP functionality "Check for User Messages" was introduced in 2013R2. 

    You are correct my blog posts describes all these issues. 

    I am not aware of a way to obtain this information without using an add-in of some kind to provide the information. To help me understand your issue, could you tell me what it is that you need to use the information for, once you have it, it might inspire me to an alternative approach? 

    Tim.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans