Provision Active Directory Groups
Role Model tutorial · Step 1 of 2
Create the AD groups that will be managed through the role model.
Create the AD groups before assigning membership through a NIM role model. This example maps each HR department to one AD group, so every employee belongs to the group for their department.
Create the group filterDirect link to Create the group filter
First, we'll create a filter that outputs a column with all departments in our CSV source system.
- Go to Processing > Filters.
- Click Add.
- For the Filter Name, enter
HR500_AD_Group_Create. - Click Create.
Configure group selectionDirect link to Configure group selection
-
Select HR500.departments as the Start Table.
-
Click Filter to run the filter. The results are populated into the Result pane.
-
If AD group names should differ from HR department names, add a transformation. This example prefixes names with
DEPGRP_, convertingEN_DOCtoDEPGRP_EN_DOC. -
Go to the Columns Specification tab.
-
Click Add Script Column.
-
Enter a Column Name. For this example, we'll name the column
dep_grp_name. -
Enter your JavaScript in the Code pane. For this example, we'll use the following JavaScript:
return 'DEPGRP_'+departments['organizational_unit']. -
Click Test Script to execute your JavaScript code.
-
The result appears in the Script Result Value field.
-
Click Save and Exit.
-
Click Filter to refresh the data.
-
The HR500_AD_Group_Create filter now contains the dep_grp_name column.
-
In the Lookup tab, create these two lookups. The exclude lookup finds groups to create; the include lookup is used by the role generator.
Lookup name Filter column System Table Field Operation group_includedep_grp_nameAD Groups sAMAccountNameinclude group_excludedep_grp_nameAD Groups sAMAccountNameexclude -
Click Save.
-
Go back to the Data tab.
-
Click Filter [group_exclude] to test the exclude lookup. It should return all 39 groups, since they don't yet exist in AD:
-
Click Filter [group_include] to test the include lookup. It should return 0 groups, since they (likewise) don't yet exist in AD:
Create the group mappingDirect link to Create the group mapping
- Go to Output > Mappings.
- Click Add.
- Enter these values: System: AD; Target: Groups; Function: GroupCreate; Name:
HR500_AD_GroupCreate. - Click Save.
Configure and test the mappingDirect link to Configure and test the mapping
- Select HR500_AD_Group_Create[group_exclude] as the mapping filter. Its columns appear in Items.
Use the exclude lookup for the create mapping because it returns only groups that do not yet exist in AD.
-
In the Items pane, click the > button to preview the first record.
-
Map the group values as follows:
Attribute Item or value Note cn dep_grp_namepath OU=groups,OU=docs,DC=t4edemo,DC=comEnter the path for your environment. sAMAccountName dep_grp_name -
Click Save.
-
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.
-
The group should be successfully created in the target AD system.
Add group creation to the jobDirect link to Add group creation to the job
- Go to Output > Jobs.
- For the HR500_AD job, click Edit Job.
- Go to the Configuration tab.
- Click Add.
- For this job item, select
crudfor Type, then select the HR500_AD_GroupCreate mapping for Name. Set the Threshold to1000. Thiscrudthreshold counts pending group-create mapping operations; it does not use the membership-change count used bygroupmembershipitems. - Click Save.
Evaluate and run the jobDirect link to Evaluate and run the job
-
Go to the Execution tab.
-
Click Evaluate.
-
After a few moments, the Status changes to Initialized. This job will perform 39 group create operations.
-
Return to Scheduler > Overview and manually run the
HR500_ADschedule. -
Confirm that the schedule completes successfully and creates the remaining groups (38 in this example, after the single test group).