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 AX (Archived)

how to set up auto log out

(0) ShareShare
ReportReport
Posted on by 680

Therer is a policy to auto log out client who is not active for 15 mins. I found only parameter that have to set up individual client. Does anyone can share with me where is the parameter that i can set up as a global parameter so that i can just set up at once place and apply to all client

thk in advance

surakit A

*This post is locked for comments

I have the same question (0)
  • Jorge Rodrigues Profile Picture
    175 on at

    Hi Surakit,

    you can do this:

     

    static void Job5(Args _args)
    {
    UserInfo userInfo;
    ;
    update_recordset userInfo setting autologoff = 15;
    }

     

  • Raymi Profile Picture
    5 on at

    Can you guide me where to find that policy?

    Thanks

    Raymi

  • Suggested answer
    A.Prasanna Profile Picture
    8,223 on at

    See following thread

    community.dynamics.com/.../172168.aspx

    Thanks & Regards,

    Amith Prasanna.

  • Suggested answer
    Umesh Pandit Profile Picture
    9,315 User Group Leader on at

    Hi Surakit,

    Open AX> System Administrator>users

    select user and click user option.  In the automatic shutdown, fill in the time you want to shut down when left un-use. Default value is "0" means no auto time out!

    You get to it through the user interface of AX.  

    Path: Administration > Users > User options button > Automatic shutdown field.

    If set at 0, it will not auto-shutdown. Set it to 15 in your case! :)

    For "global parameter" and for all the user at once use this job:

    You need to create a job.

    static void User_Timeout(Args _args)
    {
        UserInfo    userInfo;
        ;
        ttsbegin;
        while select forupdate *
            from userInfo
        {
            userInfo.autoLogOff = 15;
            userInfo.update();
        }
        ttscommit;
    }

    Please check this link:

    http://msdynamicsaxtips.blogspot.in/2014/07/is-it-possible-to-kill-ax-user-session.html

    Please update your finding as well.

  • Community Member Profile Picture
    on at

    Hi

    can I exclude the admin users from this?

  • Suggested answer
    5400 Profile Picture
    7,162 on at

    Please find the code to exclude the admin user

    static void Job2(Args _args)

    {

       UserInfo   uinfo;

       SecurityUserRole   uRole;

       SecurityRole    role;

       container       con;

       int             i;

       ttsBegin;

       while select forUpdate uinfo

           join uRole where uRole.User == uinfo.id

             join role where role.RecId == uRole.SecurityRole

               && role.AotName == '-SYSADMIN-'

       {

           i ++;

           con = conIns(con,i,uinfo.id);

       }

       while select forUpdate uinfo

           join uRole where uRole.User == uinfo.id

             join role where role.RecId == uRole.SecurityRole

               && role.AotName != '-SYSADMIN-'

       {

           if (!conFind(con,uinfo.id))

           {

               uinfo.autoLogOff = 15;

               uinfo.doUpdate();

           }

       }

       ttsCommit;

    }

  • Community Member Profile Picture
    on at

    Thank you for your response

    But during running the job it give me this error

    (The name is already registered. Duplicate names are not allowed.)

    Another question please, can I exclude specific users from this job and can I change the log off time in the future

  • 5400 Profile Picture
    7,162 on at

    yes, why not. exclude user u can take one container and skip from update.

    can you tell me which job are you running.

  • Community Member Profile Picture
    on at

    I run this job

    static void User_Timeout(Args _args)

    {

       UserInfo    userInfo;

       ;

       ttsbegin;

       while select forupdate *

           from userInfo

       {

           userInfo.autoLogOff = 15;

           userInfo.update();

       }

       ttscommit;

    }

    then I edit in the same job this one

    static void Job2(Args _args)

    {

      UserInfo   uinfo;

      SecurityUserRole   uRole;

      SecurityRole    role;

      container       con;

      int             i;

      ttsBegin;

      while select forUpdate uinfo

          join uRole where uRole.User == uinfo.id

            join role where role.RecId == uRole.SecurityRole

              && role.AotName == '-SYSADMIN-'

      {

          i ++;

          con = conIns(con,i,uinfo.id);

      }

      while select forUpdate uinfo

          join uRole where uRole.User == uinfo.id

            join role where role.RecId == uRole.SecurityRole

              && role.AotName != '-SYSADMIN-'

      {

          if (!conFind(con,uinfo.id))

          {

              uinfo.autoLogOff = 15;

              uinfo.doUpdate();

          }

      }

      ttsCommit;

    }

  • Community Member Profile Picture
    on at

    now I need job to  close session after specific time and I need to exclude specific user from it

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans