Discovery Error - You cannot call a method on a null-valued expression.



  • On executing discovery for Windows devices, it fails to classify the devices and throws an error.
  • The issue is about devices not getting classified. When discovery tries to discover a device, it throws a warning during classification steps and set the status of discovery to complete. This article will demonstrate on the investigations and probable use cases, hence in future, if discovery fails with the same error, then this can be one of the cause and worth trying to fix.

Steps to Reproduce

  • Connect to ServiceNow instance.
  • Initiate quick discovery or scheduled discovery for Windows devices.
  • validate the WMI Classify probe.


  • Discovery fails to classify the device and throws the error as below

     Active, couldn't classify: No WMI connection, now finished - you cannot call a method on a null-valued expression.


  • Servicenow sends below query payload to fetch data as a part of WMI Classify step.
    <parameter name="WMI_FetchData" value="root\virtualization\v2\Msvm_ComputerSystem.Name,HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/Domain,

  • Below are the 2 parameters for which data the data is found to be missing under registry attributes. 

  • Below screenshot shows the parameters.


  • The missing values for the registry attribute are added for affected devices so that discovery can fetch the required data.
  • After making the change, discovery classifies the device successfully.