Skip to main content

NIM

Step 1: Provision groups into AD (tutorial)

Before we can manage group memberships via a NIM role model, we need to create those groups in our target system.

For this example, we'll assume a business logic with 1:1 correspondence of HR departments to AD groups. That is, we'll assume that each employee needs to be in one and only one group, and that the group is based on the employee's department.

Create a group filter

First, we'll create a filter that outputs a column with all departments in our CSV source system.

  1. Go to Processing > Filters.

    2023-07-13_12-36-38.jpg
  2. Click Add.

  3. For the Filter Name, enter HR500_AD_Group_Create.

    2023-07-13_12-40-18.jpg
  4. Click Create.

Configure the filter
  1. Select HR500.departments as the Start Table.

    2023-07-13_13-17-01.jpg
  2. Click Filter to run the filter. The results are populated into the Result pane.

    2023-07-13_13-18-19.jpg
  3. Optional: If the naming scheme of departments in the HR source system is different than the desired naming scheme of groups in the target system, a transformation is required.

    For this example, let's say we want to prefix department names with DEPGRP_. For example, the HR department EN_DOC should become the target AD group DEPGRP_EN_DOC.

    1. Go to the Columns Specification tab.

    2. Click Add Script Column.

      2023-07-13_14-19-14.jpg
    3. Enter a Column Name.

      For this example, we'll name the column dep_grp_name.

      2023-07-13_14-31-06.jpg
    4. Enter your JavaScript in the Code pane.

      For this example, we'll use the following JavaScript: return 'DEPGRP_'+departments['organizational_unit'].

      2023-07-13_14-56-26.jpg
    5. Click Test Script to execute your JavaScript code.

    6. The result appears in the Script Result Value field.

      2023-07-13_14-56-57.jpg
    7. Click Save and Exit.

    8. Click Filter to refresh the data.

    9. The HR500_AD_Group_Create filter now contains the dep_grp_name column.

      2023-07-13_15-01-33.jpg
  4. Now, we'll create both Include and Exclude lookups for the dep_grp_name column.

    We'll be using the exclude lookup to dynamically create groups in AD, and then the include lookup in a role generator to assign those groups to roles.

    Go to the Lookup tab and create the following two lookups:

    Lookup Name

    Filter Column

    System Name

    Table Name

    Field Name

    Operation

    group_include

    dep_grp_name

    AD

    Groups

    sAMAccountName

    include

    group_exclude

    dep_grp_name

    AD

    Groups

    sAMAccountName

    exclude

    2023-07-14_11-17-33.jpg
  5. Click Save.

  6. Go back to the Data tab.

  7. Click Filter [group_exclude] to test the exclude lookup. It should return all 39 groups, since they don't yet exist in AD:

    2023-07-20_9-57-45.jpg
  8. Click Filter [group_include] to test the include lookup. It should return 0 groups, since they (likewise) don't yet exist in AD:

    2023-07-20_10-01-20.jpg
Add a mapping
  1. Go to Output > Mappings.

  2. Click Add.

  3. Enter the following values:

    • System: AD

    • Target: Groups

    • Function: GroupCreate

    • Name: HR500_AD_GroupCreate

    2023-07-20_10-09-11.jpg
  4. Click Save.

    2023-07-20_10-10-04.jpg
Configure the mapping
  1. For the mapping's Filter, select HR500_AD_Group_Create[group_exclude]. Its columns are populated into the Items pane.

    Tip

    We feed the exclude lookup into the group create mapping because it returns the groups that don't already exist in the target system, i.e., the groups that need to be created.

  2. In the Items pane, click the > button to preview the first record.

    2023-07-20_10-14-28.jpg
  3. For this example, we'll map the following attributes:

    2023-07-20_10-34-15.jpg

    Attribute

    Item

    Note

    cn

    dep_grp_name

    path

    OU=groups,OU=docs,DC=t4edemo,DC=com

    You must manually type in the path.

    sAMAccountName

    dep_grp_name

  4. Click Save.

  5. Now, we'll manually test a single group create operation. Go to the Run tab. Select one of the rows in the Operation pane and click Run Selected Item.

    2023-07-20_10-38-43.jpg
  6. The group should be successfully created in the target AD system.

    2023-07-20_11-10-00.jpg
Update the HR500_AD job
  1. Go to Output > Jobs.

  2. For the HR500_AD job, click edit-job.png Edit Job.

  3. Go to the Configuration tab.

  4. Click Add.

  5. For this job item, we'll select a type of crud, and for the Name, we'll select the HR500_AD_GroupCreate mapping. We'll set the Threshold to 1000.

    2023-07-20_11-11-29.jpg
  6. Click Save.

Evaluate the job
  1. Go to the Execution tab.

  2. Click Evaluate.

  3. After a few moments, the Status changes to Initialized. This job will perform 39 group create operations.

    2023-07-20_11-15-42.jpg
Run the job from the schedule
  1. Go back to Scheduler > Overview.

  2. Click task-manual-run.png Manual Run for the HR500 schedule.

  3. Ideally, the schedule executes successfully, and 38 groups (minus the one we created during our test run) are created in AD.

    2023-07-20_11-38-30.jpg
    2023-07-20_11-41-24.jpg

Next: Step 2: Role model & generator