Showing posts with label SID. Show all posts
Showing posts with label SID. Show all posts

Tuesday, December 27, 2016

Error in getting sid AX2012

Hi Guys,

I had recently setup a new environment and it was working fine. Then suddenly one of our team members reported that he is not able to post Purchase Packing Slip. The Packing Slip screen comes and when you press OK it just goes off and does nothing. He also got an error "Failed to create a session" but just once.

I was trying to set default company and I got "Error in getting SID" error. So after doing some hit and trial I reached a really silly solution. Whichever user is facing this issue just disable the UserId from SystemAdministrator->Common->Users->Users. Select the user, click "Edit", then uncheck the "Enabled" checkbox and save the record. and enable it. Now do the reverse and check the "Enabled" checkbox and save the record. Then ask him to re-login and check. And it works now. :)

Saturday, September 14, 2013

Get SID of a User Account

To get the SID(Security Identifier) of a particular User ID we may use multiple methods. Some of them are mentioned below:

1. Using Registry Editor (only for logged in users)
  • Method 1: Goto Run(press Window+R or Start->Run), type regedit and press ok. It will open the Registry Editor then goto the following path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList and expand it. Then you have to select the folders prefixed with S-1-5-21. As you select them on the right pane of the window you will find a String type "ProfileImagePath" which will display the username.
  • Method 2: In regedit, goto the HKEY_USERS folder and the first key with prefix S-1-5-21 is currently logged in user's SID.
(NOTE: Modifying registry may cause any system-wide troubles or may even crash it)

2. Open Command Prompt, goto Run type "cmd" and press OK. Now in the command prompt type "wmic useraccount get name,sid" and it will display the list of usernames and their SID's.

3. Using scripting, open notepad and paste the below script in it:
strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") 
Set objAccount = objWMIService.Get("Win32_UserAccount.Name='administrator',Domain='Abhishek'")
Wscript.Echo objAccount.SID

Change the UserAccount.Name and Domain as per your requirement and then save the file as script.vbs(make filetype as "All types") and then run the file. It will display your SID

4. Using external tools such as PsGetSid: http://technet.microsoft.com/en-us/sysinternals/bb897417.aspx

If anybody knows any other way for this then please do comment :)

You are not recognized as a recognized user of Microsoft Dynamics Ax

You may this error when you have to import an AX database from some other environment of different domain e.g. your client's DB. In this case once you import the db and start Ax, it will throw the following error:








Now this happens because of the change in domain(new domain and users are not logged in AX DB) so we need to add users of our domain to this DB. For this we need to add an entry with SID of our "Admin" account to the "USERINFO" table.



Follow the steps:
  1. Get the SID of Admin account.
  • You can also get SID from an existing AX DB in your environment by using the SQL command:
select SID, Networkdomain, networkalias from userinfo where networkalias = '<UserAlias>'
  1. Open SQL Server Management Studio.
  2. Run the provided query
update USERINFO
set NETWORKDOMAIN = 'contoso.com', NETWORKALIAS = 'axadmin', SID = 'S-1-5-21-2423567575-2897528880-3809357285-500'
where id = 'admin'

where NETWORKDOMAIN is the DomainName of your environment where you have restored the DB and NETWORKALIAS is the username to which you want to provide access(Admin in this case).