Change of AX user domain:

  • Change of AX user domain:

    Posted by nazimlalji@hotmail.com on June 12, 2019 at 12:27 am
    • Najeem JanatAli

      Member

      June 12, 2019 at 12:27 AM

      Hello All

      We have a change of Domain for the AX users in Dynamics AX 2012. For Example from ABCJsmith to XYZJSmith

      Should we delete ABCJSmith and import XYZJSmith, which I dont think good practice as there are transactions attached

      When we are importing as XYZJSmith user ID appears as JSmith1

      Any suggestion

      Thanks and kind regards

    • Katja Schebler

      Member

      June 13, 2019 at 8:49 AM

      ?Hello Nazim,

      I did a similar task in AX4, but the fields should be the same in AX2012. Important to know is that each user has a SID of active directory AD. it is a long string like S-1-5-21-4……… I guess that each Domain has own SIDs.
      What I did was to get the SIDs of the users of the NEW Domain and put it into a new staging-table, together with the new networkalias and the user-ID (which does not change). Maybe your networkalias is the same like your old ones.

      Then I updated the userinfo-table with the data from the new staging-table via SQL. Please test it in a test-system.

      update dbo.USERINFO
      set networkdomain = c.Networkdomain_new, — = the new network domain
      Ā SID = c.SID_new,Ā Ā Ā Ā Ā  — = the GUID
      Ā networkalias = c.networkalias_new — = the AD-user
      — select id, networkdomain, sid, networkalias
      from dbo.USERINFO u
      inner join schebler.dbo.userconversion c
      on u.id = c.id
      and u.networkalias = c.networkalias_old

      — check that each networkalias is unique. the query result should get no lines
      select networkalias, count(*)
      from USERINFO
      where enable = 1
      group by networkalias
      having count(*) > 1

      Kind regards,
      Katja Schebler

      ——————————
      Katja Schebler
      NORMA GROUP Holding GmbH
      Maintal/Germany
      ——————————
      ——————————————-

    • Randy VanDeMaat

      Member

      June 13, 2019 at 8:50 AM

      I have the same issue in AX 2009, we are moving domains and I have to change all users to the new domain. If you delete and import new, not only do you lose the User relationship to transactions, the users would lose favorites, saved queries, usage data ect…

      We have written a job in AX to change the domain of the user. You can modify it slightly to just do specific users by adding criteria for UserInfo.NetworkAlias.

      static void MM_ChangeUserSID(Args _args)
      {
      UserInfo UserInfo;
      str alias;
      sid userSid;
      str domainName;
      xAxaptaUserManager mgr;
      xAxaptaUserDetails det;

      ttsbegin;
      breakpoint;
      while select forupdate userInfo
      where userinfo.networkDomain == ‘oldnetworkdomain’
      {
      info(userinfo.sid);

      mgr = new xAxaptaUserManager();
      alias = userInfo.NetworkAlias;
      domainName = userInfo.NetworkDomain;

      // Get the single user’s details from the kernel class
      det = mgr.getDomainUser(domainName, alias);

      // If Admin alias/domain are getting changed, update SID
      if(det && det.getUserCount() > 0 && det.isUserEnabled(0))
      {
      userInfo.networkDomain = ‘newnetworkdomain’;
      userSid = det.getUserSid(0);
      userInfo.sid = UserSid;
      userInfo.update();
      }
      info(userinfo.sid);

      }

      ttscommit;
      }

      ——————————
      Randy VanDeMaat
      Micro Matic USA Inc.
      Brooksville FL
      ——————————
      ——————————————-

    • Mark Prouty

      Member

      June 14, 2019 at 9:33 AM

      Test this –
      Disable user. ?Change domain reference & email (could use script for mass change).
      Re-enable user. AX will search for & apply new SID.
      Retains all user last used settings, user ids, etc.
      SharePoint might be trickier. I have notes somewhere if you need.

      ——————————
      Mark Prouty
      Programmer / Analyst
      ANGI Energy Systems
      Janesville WI
      ——————————
      ——————————————-

    nazimlalji@hotmail.com replied 6 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Change of AX user domain:’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!