A new Flexera Community experience is coming on November 25th. Click here for more information.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AD Custom Import

I’m creating an custom LDAP business adapter for importing various active directory user attributes. I’m struggling with the following items:

  1. How can I convert a retrieved value to lower case?
  2. How can I link the retrieved Manager (which is a distinguished name in AD) to an existing user in the FlexNet Manager database?
  3. How can I use a “switch” or “select case” on a retrieved value in order to write a “fixed" value in the database?

    Example
    employeeType in Active Directory which can contain user or cuser. I want to use this value to update the Employment status field.

    user => Employee
    cuser => Consultant
    Any other value = blank

  4. How can I set the Status to Active or Inactive based on the bits set in the userAccountControl attribute?

Thnx!

(6) Replies

Hi @mremkes 

The short answer is you need to do this in two steps:

1. Stage your data and normalise it

2. Import to FNMS via a business adapter

To answer your specific questions:

1.   Assuming you are staging data in SQL, there are a number of links on google for changing sentence case in a field.  This one is simple:

UPDATE titles
  SET title =      UPPER(LEFT(title, 1)) +        LOWER(RIGHT(title, LEN(title) - 1))

 

2. Refer to the user.xml DDI.  You will see that you can first pass teh manager name to the system to get a manageroutid which you then use to update the users manager value.

3. You can stage the data in an sql table, normalise it.  Or you can write a case statement in your SQL that you select the data out in.

4.  Assuming you are referring to employment status - current vs ex employee - then the userstatus field can be done as with 3 above.

Regards

 

Attached is a sample adapter that works with FlexNet Manager Suite On-premises (not Cloud) to import user data from Active Directory. This adapter illustrates handling of some similar (but a little different) scenarios as discussed in this thread:

  • Using a CASE (switch) statement to map source values to different target values - see the handling of the Employment Status property.
  • Linking users to their managers, identified by the managers' distinguished name - see the Update User Managers custom query.

Hopefully these examples give inspiration on how to go about handling the particular properties you are working with.

If you are working with FlexNet Cloud then you would need to stage and transform data locally as @Nico_Erasmus has suggested before your business adapter runs to achieve similar outcomes.

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

Hi @ChrisG ,

I'm trying to implement the solution you provided. As soon as I use the ValueType = "SQL" in the xml file, the excution of the adapter will fail with:

'SQLValue attribute found in DDI file C:\ProgramData\Flexera Software\Beacon\IntermediateData\BI_Import AD Users\ddi.xml.'

Also when I try to use the 'Use Physical table' option, the execution of the adapter will fail with:

'UsePhysicalTable attribute found in DDI file C:\ProgramData\Flexera Software\Beacon\IntermediateData\BI_Import AD Users\ddi.xml.'

Apparently I'm missing something here...

These messages suggest that you are attempting to run the adapter on a beacon here in a "standalone" fashion which does not connect directly to the compliance database while the adapter is running. An adapter using the features you are trying to use should be executed on the FlexNet application server, where it will be able to connect to the compliance database as it is running.

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

In addition to the last update by Chris, if you have FNMS Cloud, then you cannot include native SQL commands in a Business Adapter as for obvious reasons we cannot allow you to upload direct SQL commands to our hosted database.

If you have FNMS Cloud, then the best solution would be the one that was previously mentioned in this thread, which would be to load your AD information into a Staging Database, transform the data in the Staging DB with SQL, and then write a Business Adapter connected to your Staging DB as the source and then upload to FNMS Cloud.

Kirk

Hi @Nico_Erasmus 

Thank you for your answer. I was hoping I could resolve this without using the staging database. As we are using the FlexNet Manager Suite On-premises I’m first going to investigate the solution provided by @ChrisG before diving into staging databases.