Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

New-AXUser: Error in getting SID

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey all,

I'm automating the process of creating a user in AD and in AX. However, I'm facing some issues with adding the user in AX part.

I'm testing in 2 AX environments at the moment (I'll name them A and B), and in environment A it works without a problem, but in B I get the error: Error in getting SID, The Active Directory user or group does not exist. Contact your network administrator.

Both tests are with the same user and the same code, only the server is different. Am I missing something that needs to enabled on the server before I can add users via powershell? I can reach the domain controller from both servers, and manually adding the user via the AX GUI also works.

The code I use is as follows:

Invoke-Command -ComputerName $AOSserver -ScriptBlock {param($axuserid,$accountname,$AOScompany,$domain) New-AXUser -AccountType WindowsUser -AXUserId $axuserid -UserDomain $domain -UserName $accountname} -Credential $axCredential -ArgumentList $axuserid,$accountname,$AOScompany,$domain

I don't seem to have issues with other AX commands, for example I can execute the following one against environment B without any problems:

Invoke-Command -ComputerName $AOSserver -ScriptBlock {Get-AXUserLicenseUsage} -Credential $axCredential

I have tried executing the code locally on the server itself, but same result.

Any help would be appreciated.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: New-AXUser: Error in getting SID

    The 2012 R2 is working correctly, the 2016 isn't. Well, only for the New-AXuser command, besides that everything works fine on the 2016 environment.

    The following KB is installed for AX2012 R3 on the 2016: KB4457935-6.3.6000.7046

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: New-AXUser: Error in getting SID

    And which one of those is working correctly?

    Windows Server 2016 is supported for AX2012 R3 with AX 2012 R3 cumulative update 12 with KB4010490 and KB3217883, according to the System requirements. You seem to have CU13 on that server (6.3.6000), so maybe these fixes are included. But it's good to double check.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: New-AXUser: Error in getting SID

    Hey André,

    They are running in the same domain. The only difference between the environments is the AX build numbers and the operating system.

    Environment A:

    AX build version: 6.3.4000

    OS: Windows Server 2012R2

    Environment B:

    AX build version: 6.3.6000

    OS: Windows Server 2016

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,642 Super User 2024 Season 2 on at
    RE: New-AXUser: Error in getting SID

    Hi Glenno,

    Like Nikolaos, I'm also thinking in the direction of the domain. Are these environments running in the same domain or are they different?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: New-AXUser: Error in getting SID

    1) Yes, they are correct

    2) Yes, manually works on both of them

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: New-AXUser: Error in getting SID

    1) Did you check that you have the good (=existing) values in $axuserid and $domain variables on both servers? You could try to print your actual New-AXUser command in the screen before executing it, so you can see if there's something funny.

    2) Can you succesfully import AD users manually (from AX UI) in both environments?

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans