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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Is there anyway ..... If user is not using GP for 10 minuets, his/her access should be removed

(0) ShareShare
ReportReport
Posted on by 1,821

Hi,

We need to remove the login access in GP, if user does not use GP for 10 minutes.  Is ther nay way we can do this.  Kindly help me .... with details ..

Regards,

Noushad

*This post is locked for comments

I have the same question (0)
  • Tim Wappat Profile Picture
    5,711 on at

    Do you mean log the user out rather than deactivating the account?

    If this is the case then Rockton have a tool in the toolbox product for this:

    www.rocktonsoftware.com/.../dynamics-gp-toolbox

  • MichaelTsai Profile Picture
    77 on at

    I use the GP Toolbox, works well.   I tested the feature and other features in GP Toolbox, no issues.  I do not use this specific log off feature.  Rockton support are superb also

  • P NOUSHAD Profile Picture
    1,821 on at

    Hi All,

    Thanks for your reply.  I will make it clear my requirement.  if the user kept GP idle (without any activity) for 30 minutes, there should be some automation to remove his GP user access from GP or logout automatically from GP.  So other user can use his access.  This is the objective of this requirement.

    Kindly help me.  Is there any way we can achieve this requirement other than using 3rd party product.

    Regards,

    Noushad

  • Tim Wappat Profile Picture
    5,711 on at

    There is no native way to do this safely without a 3rd party product.

    Tim.

  • Suggested answer
    MG-16101311-0 Profile Picture
    26,225 on at

    Use at your own risk:

    DECLARE @tTable TABLE (sqlsvr_spid INT);
    
    INSERT @tTable
    SELECT
    	S.sqlsvr_spid
    FROM DYN18..ACTIVITY A
      LEFT JOIN DYN18..SY01400 U on A.USERID = U.USERID
      LEFT JOIN DYN18..SY01500 C on A.CMPNYNAM = C.CMPNYNAM
      LEFT JOIN tempdb..DEX_SESSION S on A.SQLSESID = S.session_id
      LEFT JOIN master..sysprocesses P on S.sqlsvr_spid = P.spid and ecid = 0
      LEFT JOIN master..sysdatabases D on P.dbid = D.dbid
    WHERE datediff ( mi, P.last_batch, getdate() ) >= 30;
    
    DELETE A
    FROM DYN18..ACTIVITY A INNER JOIN 
    (
    SELECT
      CASE
        WHEN S.session_id is null
          THEN 'Missing DEX_SESSION'
        WHEN A.USERID <> P.loginame or P.loginame is null
          THEN 'Phantom'
      ELSE ''
      END MismatchOnUserID,
      CASE
        WHEN datediff ( mi, P.last_batch, getdate() ) > 90
          THEN 'Idle ' + str (  datediff ( mi, P.last_batch, getdate() ) )
        ELSE '' 
      END AS Working
      , A.USERID
      , A.CMPNYNAM
      , INTERID
      , LOGINDAT + LOGINTIM LoginDatestamp
      , SQLSESID
      , P.login_time
      , P.last_batch
      , datediff ( mi, P.last_batch, getdate() ) SinceLastAction
      , S.session_id
      , S.sqlsvr_spid
      , P.spid
      , P.status
      , P.net_address
      , P.dbid
      , P.hostname
      , P.loginame
    FROM DYN18..ACTIVITY A
      LEFT JOIN DYN18..SY01400 U on A.USERID = U.USERID
      LEFT JOIN DYN18..SY01500 C on A.CMPNYNAM = C.CMPNYNAM
      LEFT JOIN tempdb..DEX_SESSION S on A.SQLSESID = S.session_id
      LEFT JOIN master..sysprocesses P on S.sqlsvr_spid = P.spid and ecid = 0
      LEFT JOIN master..sysdatabases D on P.dbid = D.dbid
    ) SQL_ACTIVITY ON (A.USERID = SQL_ACTIVITY.USERID)
    WHERE SQL_ACTIVITY.SinceLastAction >= 30
    
    DELETE FROM tempdb..DEX_SESSION WHERE sqlsvr_spid IN (SELECT sqlsvr_spid from @tTable)
    


    You can schedule a SQL job to run this script, or you can preferably create a stored procedure with it and schedule a SQL job to run the stored procedure, rather. Please at least test it in a test environment, before deploying into production.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans