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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Update User Info with new email and SID

(0) ShareShare
ReportReport
Posted on by

Hi, I need to run an update on the UserInfo Table. 

We are changing domain names.  Consequently, I am changing the Network Alias and the new Corresponding SID number for dynamics users.

Everything else is staying the same.

I am getting the SID like this:

 Newsid              = manager.getUserSid(newEmail,networkDomain);

I am getting the domain name like this:

networkDomain = Microsoft.Dynamics.ApplicationPlatform.Environment.EnvironmentFactory::GetApplicationEnvironment().get_Provisioning().get_AdminIdentityProvider();

This seems to work, but I want a sanity check and I'm not sure exactly the nature of this reference.

Can someone explain it?

Will this function in the UAT and PROD the same as it does in Dev?

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    300,982 Super User 2025 Season 2 on at

    Hi Brianmaric,

    Is your question related to Dynamics 365 or Dynamics AX 2012 (or earlier versions)? If it is Dynamics 365, then you have to test the coding carefully as there might be some differences. For Dynamics AX 2012 or before, the coding should work the same.

    If you are running Dynamics 365, you can also use Power Automate to change the domain: How to setup demo users in Microsoft Dynamics 365 for Finance and Operations - Dynamicspedia

  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,390 Super User 2025 Season 2 on at

    Hi brianmaric 

    in AX 2012 you can use this method

    whoami /user 

    pastedimage1650838840323v1.png

    update userinfo set

    Name = 'Mohamed Amine Mahmoudi',

    NETWORKDOMAIN = 'YOURDOMAIN.local',

    NETWORKALIAS = 'Username',

    SID = 'S-1-5-21-1694458270-169399854-1149528589-12722'

    where RECID = 5637144000

  • brianmaric Profile Picture
    on at

    I suppose that my question is:

    Does this value change: https://sts.windows.net/

    ....when the tenet stays the same and the user email (Network Alias) changes from @abc.com to @cde.com

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    300,982 Super User 2025 Season 2 on at

    Hi Brianmaric,

    If the tenant remains at @abc.com and the users are on @cde.com, then you have to change the value in the Provider field.

    You can then use e.g. sts.windows.net/cde.com

  • brianmaric Profile Picture
    on at

        networkDomain = Microsoft.Dynamics.ApplicationPlatform.Environment.EnvironmentFactory::GetApplicationEnvironment().get_Provisioning().get_AdminIdentityProvider();

    but then this code should grab the new value...

    Is that right?

  • brianmaric Profile Picture
    on at

    But if the tenant stays the same and the domain changes to @cde.com then the Provider field stays the same, right?

  • André Arnaud de Calavon Profile Picture
    300,982 Super User 2025 Season 2 on at

    Hi Brianmaric,

    I have no idea about the outcome of this code in your scenario as I don't know if the admin account is configured for abc.com or cde.com.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 659 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 533 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 289 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans