Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Import department and company via AD to servicenow

Mani60
Tera Contributor

Hi There,

 

I need to import the core_company data and cmn_department data from AD to Servicenow, so how can import that Data, i'm not having any idea on this, so somebody can please help me on this.

 

Thanks,

2 REPLIES 2

Deepak Shaerma
Kilo Sage
Kilo Sage

Hi @Mani60 

Step 1: Set Up LDAP Integration

1. Configure LDAP Server:
- Navigate to System LDAP > LDAP Servers.
- Click New to create a new LDAP Server record.
- Fill in the connection details for your AD server (Host name, Port, etc.).

2. Test the Connection:
- Use the Test Connection action to ensure that ServiceNow can communicate with the LDAP server.

3. Add LDAP OU Definitions:
- Navigate to the OU Definitions related list on the LDAP Server record.
- Configure the Organizational Units (OUs) where your core_company and cmn_department data reside.


Step 2: Set Up Data Sources in ServiceNow

1. Create Data Sources:
- Navigate to System Import Sets > Administration > Data Sources.
- Click New to create a Data Source for both Company and Department.
- Name the Data Source appropriately, e.g., “LDAP Company Import”, “LDAP Department Import”.
- Populate the fields required to connect to the LDAP data, such as the LDAP Server, Base DN, etc.

2. Load Data into Import Set Tables:
- After creating the Data Sources, load the data from LDAP into temporary Import Set Tables.

Step 3: Create Transform Maps

1. Create Transform Maps:
- Navigate to System Import Sets > Administration > Transform Maps.
- Click New to create a new Transform Map.
- Select the Import Set Table from your Data Source.
- Select the target Tables, which are core_company and cmn_department.

2. Define Field Mappings:
- In the Transform Map, map the fields from the LDAP Import Set Table to the fields in the target Table.
- Ensure that mandatory fields are mapped correctly.

3. Script Transform Maps (Optional):
- If you need to manipulate data before processing, you can add Transform Scripts.

Step 4: Run the Import and Transform

1. Import Data:
- Navigate to the Data Source and schedule a data import or run it manually.
- Load the data into the Import Set Table.

2. Transform Data:
- Once your data is loaded into the Import Set Table, initiate the Transform process.
- Validate the data in the target Table.

Step 5: Scheduling and Automation (Optional)

1. Scheduled Data Imports:
- If you need periodic imports, you can set up Scheduled Data Imports.
- Navigate to System Import Sets > Scheduled Imports and create a new Schedule for your Data Sources.

2. Configure LDAP Schedules:
- Set up LDAP Query Schedules that will run at regular intervals to keep the data in sync with AD.


1. Create an LDAP Server record.
2. Configure a Data Source for cmn_department.
3. Create an Import Set Table and Populate it using the Data Source.
4. Create a Transform Map from Import Set Table to cmn_department.
5. Map fields accordingly.
6. Run the data import and transform.
7. Validate imported data in cmn_department.


Note: this is search generated steps.
Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning ‌‌
Thanks & Regards
Deepak Sharma




Harish KM
Kilo Patron
Kilo Patron

Hi @Mani60 here is the article on the steps you need to follow

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0961314

Regards
Harish