We are running Lawson 10.0.7. I am working on a SQL query to identify some journal entries out of the GLTRANS table and I need to be able to show the real username instead of the operator that begins with NT00.... I cannot seem to find any SQL table that I can join to in order to provide this information in the results of the query. Does anybody have any idea?
Thank you in advance and Happy New Year!!
Allen
In order to convert from NT_ID to username/userid, we need to combine info from GEN and the Lawson Security LDAP repository. You can utilize whatever tools you have/are comfortable with to accomplish this. I'm using SQL Server Integrations Services (SSIS) as my basic framework. 1) Query into GEN to pull the UID and NT_ID SELECT CONVERT(INT, CONVERT(VARBINARY, Replace([USERNAME], 'NT', '0x'), 1)) AS [UID], [USERNAME] AS [NT_ID] FROM dbo.USERINFO ORDER BY [UID] 2) Query into Lawson Security LDAP on your LSF server to pull USERNAME, UID and EMPLOYEE I wrote a C# script to use as a datasource in SSIS. I utilized the SearchRequest class from System.DirectoryServices.Protocols. Hopefully, you're familiar with querying LDAP, as it's entirely different. If not, there's good examples available online. I used the Microsoft documentation. Your LDAP schema is most likely a bit different from ours, so you'll need to modify the targetDN accodingly. Here's what I used, which should get you to the right place. targetDN = "CN=lsfprod,OU=svcxref,O=lwsnSecData,O=lwsn,DC=genesishealth"; ldapSearchFilter = "(cn=*)"; string[] attributesToReturn = new string[] { "lwsnssoAllAttrValueList", "lwsnssoListOfIDs" }; You'll find USERNAME and UID in the lwsnssoAllAttrValueList attribute. It's a multivalue attribute and the sub-attributes aren't necessarily always in the same order for every record, so you'll have to parse each record to make sure you get eveything sorted out properly. lwsnssoAllAttrValueList.DOMAIN_USER --> USERNAME lwsnssoAllAttrValueList.UID --> RAWUID You can get EMPLOYEE from the [0] instance of lwsnssoListOfIDs: lwsnssoListOfIDs[0] --> EMPLOYEE 3) Clean up the LDAP data You'll need to clean up the LDAP query results. UID and USERNAME need to be formatted a bit. I do the following in a Derived column transformation in SSIS: UID is: (DT_I4)TOKEN(RAWUID,":",2) USERNAME is: TOKENCOUNT(USERNAME,"\\") == 2 ? (TOKEN(TOKEN(USERNAME,":",2),"\\",2)) : (TOKEN(USERNAME,":",2)) 4) Join the LDAP query results to the GEN query results based on UID. I'm taking the results of this and loading it into a table in LAWSON to be used as a 'crosswalk' table that can be joined to in order to convert NT_ID to username and/or employee_id. This table is refreshed daily, but you could refresh it as often as you need.