Skip to main content

Orphan Companies with strange characters being created from SCCM Service Graph Connector (Mojibake)

Toby Comer

Overview

A client was experiencing a strange issue. Dozens and dozens of companies were being created with bogus Chinese, Japanese and Burmese characters following an otherwise normal name. To make matters worse, these companies didn’t have any associated records with them. Was it foreign involvement? Fortunately, not.

What do the characters mean?

Apparently, it’s called Mojibake. I can try to paraphrase, but anything I’ll write would just be regurgitated from wikipedia anyways: https://en.wikipedia.org/wiki/Mojibake

The characters don’t mean anything in succession, but some of my favorite translations were “VMWare Trample Righteous Dazzle” or “Intel Corporation Ken Decorate Hog” (Thanks to Google Translate), Some other examples are pasted below.

How did we track it down?

Looking at the times these records were created, it was clear that they were from SCCM. Then by looking at the sys_import_set_run table, we could track it down to the Software import. Then through the Integration Studio, we could find out the Transform Script it was using to cleanse the company.

Why were they orphaned?

Thanks in part to ServiceNow’s processing logic, the company is created before it is used. Yes, companies are created before the row is even transformed, thanks to this line:

company = new CmdbIntegrationCompanyModelUtil().cleanseCompany(company);

Even if the row is rejected, or the Manufacturer is changed, the company is already created! Not good!

How did we fix it?

We could have easily added a line in CmdbIntegrationCompanyModelUtil, but that’s a high priority file type. Even the script include that calls that one is a high priority file type.

So in order to prevent skipped records on upgrades, the best thing to do is to create a new script include that calls those, and update the “Cleanse Software Model” sys_rte_eb_operation_type record to call that new custom Script Include.

For this major problem, the fix was quite simple. ' The one line of code we added was:

text = text.replace(/[^\\x00-\\x7F].*/, ""):

  • terate GmbHḹ鑴܀耀Uninstall
  • terate GmbHḹ鑴܀耀Uninstall
  • iterate GmbHῙ҅ഀ谀Ⅼ涄쿨´
  • iterate GmbHத﷑⠀耀Microsoft
  • iterate GmbHၰ쇲℀谀Ⅼ擒쵈ɻ
  • iterate GmbHᕑ⮶ఀ谀Ⅼ掎꫘͘
  • iterate GmbH᧠⢀㤀耀20240930
  • iterate GmbH㐒㐀耀Microsoft
  • iterate GmbH㞊⬀耀Software
  • iterate GmbH䊵﫣Ѐ耀Microsoft
  • iterate GmbH䡍㡪ఀ谀Ⅼ燲̾
  • iterate GmbH䩉鰔㐀耀Uninstall
  • iterate GmbH侬﬋㴀耀Software
  • iterate GmbH棙栓ࠀ耀Microsoft
  • iterate GmbH没➹⸀谀Ⅼ泒롰˧
  • iterate GmbH滇쭆⸀耀ᆸ榪팀ˆ