D365 Finance & Operations and Dynamics AX Forum

Expand all | Collapse all

Change of AX user domain:

  • 1.  Change of AX user domain:

    Posted Jun 12, 2019 12:27 AM
    Hello All

    We have a change of Domain for the AX users in Dynamics AX 2012. For Example from ABC\Jsmith to XYZ\JSmith

    Should we delete ABC\JSmith and import XYZ\JSmith, which I dont think good practice as there are transactions attached

    When we are importing as XYZ\JSmith user ID appears as JSmith1

    Any suggestion

    Thanks and kind regards
    Academy - Online Interactive Learning from Experts

  • 2.  RE: Change of AX user domain:

    Posted Jun 13, 2019 08: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

    Academy - Online Interactive Learning from Experts

  • 3.  RE: Change of AX user domain:

    Posted Jun 13, 2019 08: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;

    while select forupdate userInfo
    where userinfo.networkDomain == 'oldnetworkdomain'

    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;



    Randy VanDeMaat
    Micro Matic USA Inc.
    Brooksville FL

    Academy - Online Interactive Learning from Experts

  • 4.  RE: Change of AX user domain:

    Posted Jun 14, 2019 09: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

    Academy - Online Interactive Learning from Experts

If you've found this thread useful, dive deeper into User Group community content by role