Skip to main content

Posts

Showing posts with the label sid

Get SID [Security ID] of windows user using X++ [Dynamics AX]

I was just wondering if there is any way to get the security Id [SID] of windows users. Sometimes knowing SID of system is very much helpful specially when the user in the database has been deleted or database is migrated/upgraded incorrectly. Ofcourse, we can get the SID’s easily from the system by opening registry editor and selecting HKEY_USERS in left pane to expand it, in left pane itself you will find the SID of users.But, below is the simple code to get the SID’s of windows users using X++ Code. Note: xAxaptaUserManager class – getuserId() also helps to get SID. static void SR_GetUserSID(Args _args) { str windowsUser = ‘companyDomain\\sreenath.reddy’; // DomainName\\userId #Aif #File networkALias alias; networkDomain domain; int pos, len; sid userSid; Microsoft.Dynamics.IntegrationFramework.Util util; ; //Split the windowsUser into domain and alias len = strlen(windowsUser); pos = strfind(windowsUser, #FilePathDeli...

Comparing AX and Active Directory User Accounts

metod 1 I was recently working with an AX 2009 customer who wanted to compare the user accounts configured in AX with the user accounts in Active Directory. The basic goals were: 1.Find all AX user accounts that no longer exist in Active Directory. 2.Find all accounts that are disabled in Active Directory but not in AX. It would be great if AX would flag these scenarios for you, but unfortunately it doesn't. If you’re interested in knowing if you have any orphaned accounts or accounts that should probably be disabled in AX, here’s a quick way to do just that. 1.Export AD users to a CSV file. I used a PowerShell command for this step. The command I used requires the Active Directory Module for Windows PowerShell. This is installed by default on domain controllers, but it is also available via the Remote Server Administration Tools for Windows 7 if you want to run it from a workstation instead. http://www.microsoft.com/download/en/details.aspx?id=7887 2.Create a table for the AD ...

Easy way to get sid

Most of the time when we switch back and forth from staging to production environment, we want to get the SID for the current user setting, here are the steps you can perform to scussfully logon to Dynamics AX: 1. Open the command prompt and type "wmic path win32_useraccount where name="{Domain user name}" get sid" 2. Copy the SID. 3. Open the SQL server and write following command to update current admin user: use {AX DB} update USERINFO set SID = '{paste the SID here from step#2}', NETWORKDOMAIN='{Network domain}', NETWORKALIAS='{User Id}' where ID='Admin'