The following procedure describes a method to disable Active Directory accounts based on the value of a field in the source file (.CSV). In this example, when the job runs it will match the ID column from the source file (.CSV) against the EmployeeID attribute in Active Directory. Then use the value in the Status column of the source file (D) to determine which accounts should be disabled. Below is a sample of the table used for this scenario:
ID,Type,Status
10001,Employee,A
10002,Employee,D
10003,Employee,D
10004,Contractor,D
10005,Employee,A
10006,Employee,D
Test the scenario provided above by following the steps below :
1. Using the DTM console, open the DTM Job being used to disable accounts in Active Directory.
2. When the DTM job wizard opens, click on the “Next” button until the “Select Destination Fields” page appears (Step 4 of 10). In the All Fields window locate the “Disable Account” pseudo attribute in the list. Double click on the pseudo attribute to move it to the Selected Fields window. Then click on the “Next” button to continue.
3. On the “Connect Synchronized Fields” page (step 5 of 10), click on the Transform button (…) for the “Disable Account” field.
4. Click on the dropdown arrow and select the “Script – write a Visual Basic.Net script to assign a value programmatically” transform option.
5. Click on the “Edit Script” button to open the Visual Basic.NET Script Editor. Copy the script below and paste it into the editor window:
Dim sResult
sResult = "False"
If DTM.Source("Status") = "D" Then sResult = "True"
DTM.Result = sResult
6. Click on the “Check Mark” to test the script. After the script has been tested, close the test window. Click on the “OK” button to close the script editor. Then, click on the “OK” button to close the transform dialog box.
7. Click on the “Finish” button to close the wizard and save the changes.
8. Right-click on the DTM job and select “Preview” to perform a simulated update of the job. When the run simulation is complete, select the “Reports” tab to view the results that would take place in an interactive job run.