SQL to Active Directory
Step-by-step guide to importing users from SQL and provisioning them in Active Directory
Scenario
Section titled “Scenario”This use case imports users from a SQL table and provisions them in Active Directory.
The downloadable ZIP package for this use case includes two schedulers with corresponding pipes: one for user creation and one for user updates.
During the import process, a validation step ensures that users do not already exist in Active Directory. If a user already exists, the creation step is skipped. Once a user is successfully created, the use case writes back the generated user identifier to the SQL database as part of the pipeline execution.
In addition, a separate pipe handles updates of existing users. If the department column is modified in the SQL table, the corresponding user object in Active Directory will be updated accordingly.
Prerequisite
Section titled “Prerequisite”- A server with the latest version of FortifiedID Control installed
- An Active Directory environment configured and accessible
- A SQL server configured and accessible
- SQL Server Management Studio, or another SQL client that can create the example database and run the included scripts
- Access to Management Center with permission to update Control configuration and deploy changes
Configuration
Section titled “Configuration”Download and add the two schedules
Section titled “Download and add the two schedules”- Download the ZIP package for the use case.
- Click https://share.fortifiedid.se/index.php/s/pSZDzZTJ2nLpkRb to download the use case package.
- Unzip the file.
- The package contains two schedules that will be added to Management Center.
- The package also contains scripts for creating the SQL database and adding example users.
- Add the two schedules to the schedule folder.
- Open a file explorer.
- Go to drive:\path\FortifiedID\mgmt-center\data\customer\control\config\modules\flows.
- Drop the two schedules into this folder.
- Refresh Management Center Control and verify that the schedules are visible.
- In Configuration and Schedules, there should be a category called HR -> Active Directory.
Create and configure SQL database with some example data
Section titled “Create and configure SQL database with some example data”- Open SQL Server Management Studio.
- Manually create a database called state.
- First run the script in the zip-file called, create_temp_hr_users.sql
A table called dbo.temp_hr_users has now been created. - Then run the script in the zip-file called, add_test_users_to_sql.sql
A number of test users have now been added to the table.
Update globals to match your Active Directory and SQL database
Section titled “Update globals to match your Active Directory and SQL database”All environment references in this use case use globals. Change the values below to match your environment.
-
Open Management Center Control.
-
Click the Configuration tab.
-
Expand Misc settings.
-
Click Globals.
-
Add the following keys.
The paths below are examples. You can either create the same structure in your environment or change the values to match your own structure."ad_edition_name" : "ad_edition","ad_edition_host" : "127.0.0.1","ad_edition_port" : 636,"ad_edition_use_ssl" : true,"ad_edition_ssl_trust_all" : true,"ad_edition_base_dn" : "OU=FortifiedID_Control,DC=company,DC=local","ad_edition_bind_dn" : "your_admin_account","ad_edition_bind_password" : "your_admin_password","ad_edition_userprincipalname_suffix" : "@company.local","ad_edition_add_users_dn" : "OU=users,OU=FortifiedID_Control,DC=company,DC=local","ad_edition_add_groups_dn" : "OU=groups,OU=FortifiedID_Control,DC=company,DC=local""db_sql_1_namespace": "sqlexpress","db_sql_1_driver": "com.microsoft.sqlserver.jdbc.SQLServerDriver","db_sql_1_url": "jdbc:sqlserver://127.0.0.1:1433;database=state;encrypt=false","db_sql_1_username": "sa","db_sql_1_password": "your_sa_password","db_sql_1_encryption_key": "your_encryption_key", -
Change the values above to match your environment.
-
Click Update.
Add an LDAPClient module
Section titled “Add an LDAPClient module”The LDAPClient module uses the globals configured in the previous step.
-
Open Management Center Control.
-
Click the Configuration tab.
-
Expand Modules and click + to add a new module.
-
Add an LDAPClient.
-
Click JSON mode and paste the data below. It uses the values added to globals.
{"name": "LdapClient","enabled": true,"instances": 1,"config": {"name": "${globals.ad_edition_name}","connection": {"host": "${globals.ad_edition_host}","port": "${globals.ad_edition_port}","bind_dn": "${globals.ad_edition_bind_dn}","bind_password": "${globals.ad_edition_bind_password}","use_ssl": "${globals.ad_edition_use_ssl}","ssl_trust_all": "${globals.ad_edition_ssl_trust_all}"}},"display_name": "AD Edition"} -
Click Update.
Add a JDBCClient module
Section titled “Add a JDBCClient module”The JDBCClient module uses the globals configured earlier for the SQL database connection.
-
Open Management Center Control.
-
Click the Configuration tab.
-
Expand Modules and click + to add a new module.
-
Add a JDBCClient.
-
Click JSON mode and paste the data below. It uses the values added to globals.
{ "id": "jdbcclient_1", "name": "JdbcClient", "config": { "name": "${globals.db_sql_1_namespace}", "db_driver": "${globals.db_sql_1_driver}", "jdbc": { "url": "${globals.db_sql_1_url}", "user": "${globals.db_sql_1_username}", "password": "${globals.db_sql_1_password}" } }, "display_name": "Local SQL Express DB", "description": "Create and update users from SQL to AD (Scheduled)" } -
Click Update.
Deploy settings to Control
Section titled “Deploy settings to Control”- Click the settings button in the top-right corner of Management Center.
- Click Deploy.
- Changes will be saved and service restarted.
Test the configuration
Section titled “Test the configuration”Test the create schedule
Section titled “Test the create schedule”-
In Management Center, click Configuration -> Schedule.
-
Under the HR -> Active Directory category, click SQL -> AD (Create).
-
Click the associated pipe called SQL_AD_Create_pipe.
-
In the upper-right corner, click the Test button.

-
Click Run Pipe.
-
Check the Test UI and the server.log file for errors.
-
If the pipe completes without errors, verify that the users have been created in the target Active Directory OU.
-
Verify that the generated user identifiers have been written back to the SQL table.
Test the update schedule
Section titled “Test the update schedule”-
Open the SQL table and change the department for one or more of the users created by the first schedule.
-
In Management Center, click Configuration -> Schedule.
-
Under the HR -> Active Directory category, click SQL -> AD (Update).
-
Click the associated pipe called SQL_AD_Update_pipe.
-
In the upper-right corner, click the Test button.

-
Click Run Pipe.
-
Check the Test UI and the server.log file for errors.
-
If the pipe completes without errors, verify that the corresponding users in Active Directory have updated department values.
Adjust configuration for production
Section titled “Adjust configuration for production”Before using this configuration in production, review the example values and replace them with values that match your security requirements.
- Use proper certificate validation for LDAPS instead of trusting all certificates.
- Use service accounts with only the permissions required for the SQL and Active Directory operations in this use case.
- Store and protect database and directory credentials according to your operational security policy.