web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

New-AXUser: Error in getting SID

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • nmaenpaa Profile Picture
    101,172 Moderator on at

    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?

  • Community Member Profile Picture
    on at

    1) Yes, they are correct

    2) Yes, manually works on both of them

  • André Arnaud de Calavon Profile Picture
    306,739 Super User 2026 Season 2 on at

    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
    on at

    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

  • nmaenpaa Profile Picture
    101,172 Moderator on at

    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
    on at

    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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans