Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Windows OS - Desktops Pattern is not inserting specified serial number - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Windows OS - Desktops Pattern is not inserting specified serial number
KB0747411

Windows OS - Desktops Pattern is not inserting specified serial number


754 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

When you customize the Pattern Windows OS - Desktops to choose a specific serial number to add to the cmdb for the CI in Discovery, it does not work. It always inserts the first serial number that is found. (This is Step 5 of the Pattern: Insert Serial Number to cmdb_ci_computer - the value field in this step specifies an array element number-$cmdb_serial_number[1].serial_number. Changing it to element 2 does not work.) 

Release

Kingston/London/Madrid

Cause

The Pre/Post Processor Script for the Windows OS - Desktops Pattern contains a line of code that overrides the settings in the pattern and will always write element[1] of the array of serial numbers to the cmdb CI item that is discovered

Resolution

  1. Navigate to the Pre/Post Processor Script for the Windows OS - Desktops Pattern: https://<instance_name>.service-now.com/nav_to.do?uri=sa_pattern_prepost_script.do?sys_id=5c2729a40f2f920051a9fa6ce1050e55
    1. Note - In some newer versions, you will need to go to the pre script 'OSs - Pre Sensor' instead
  2. Comment out Line 198 where it reads "handleWindowsHardwareInformation();"
    1. The line number might be slightly different, depending on version and patch of the instance. 
    2. It can also appear as handleHardwareInformation(mainCis[ciKey].lookup) in newer versions, in the 'OSs - Pre Sensor' pre script.
  3. Modify the array element described in the "Symptoms" section of this article to match the serial number you desire to associate with the CI. *You can always look in the payload of the Pattern to determine which array element your desired serial number is.
  4. Save and publish the pattern and do a cache.do to make sure the changes take effect.
  5. Run the Discovery

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.