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.

Remapping of companies to respective domain

puja kumari
Tera Contributor

Hi All ,

 

How to remap the companies with particular domain , currently companies are mapped to default domain that's why new users logs in with default domain. 

 

Thanks

4 REPLIES 4

Chaitanya ILCR
Mega Patron

Hi @puja kumari ,

create a domain record first for each company

ChaitanyaILCR_0-1753428656190.png

and go the company record and update the sys_domain record with the domain created

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

puja kumari
Tera Contributor

@Chaitanya ILCR ,

i created the domain but not able to update the domain in company record. Any other solution?

Bhimashankar H
Mega Sage

Hi @puja kumari ,

 

 

1. Review Current Company-to-Domain Associations

  • Navigate to the Company table (core_company) in your instance.

  • Add the Domain (sys_domain) field to your Company form layout if not already visible.

2. Update Company Domain Assignments

  • For each company, set the Domain field to the correct domain.

    • Open a company record.

    • Set the Domain field to the sys_domain entry that matches your intended data separation or access requirements.

  • Save the record. This will remap the company to the new domain.

3. Verify User and Company Mapping Flow

  • When a new user is linked to a company:

    • The user inherits the company’s domain by default.

  • The user’s Domain should now reflect the intended value.

4. Automate Remapping (Bulk Updates or Script)

If you have many companies to remap:

  • Use a list edit or a script to update the sys_domain field in bulk.

    • Example scripted logic:

var company = new GlideRecord('core_company');
company.addQuery('name', 'YOUR_COMPANY_NAME');
company.query();
if (company.next()) {
   company.sys_domain = 'TARGET_DOMAIN_SYS_ID';
   company.update();
}

 

  • For automated mapping, ensure any user provisioning (e.g., LDAP import) uses the correct company-domain relationship.

 

Thanks,
Bhimashankar H

 

-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!

Bhimashankar H
Mega Sage

Hi Puja,

 

I hope you saw my reply. 


If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. It will help future readers as well having similar kind of questions and close the thread.

Thanks,
Bhimashankar H