Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Unanswered

New-AXUser: Error in getting SID

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.

  • 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,148 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... 290,252 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,148 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?

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans