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.