Loading...
Loading...
Customers are migrating from JEA v1 to v2 as per recommendation article https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0965705. When they followed step by step the configuration mentioned in the article and then ran the Quick Discovery via WinRM, it failed on the WMIRunner topic on the WMI: Clasify phase with the following error: 2024-10-07T15:05:48.833+0200 DEBUG (PowerConsole-374d042287c51a10ad9c624d8bbb3523>stderr) [PowerConsoleStreamGobblerErr:73] STDERR 659d243c-8b1b-4e92-bae8-1f6ecfb2c0f8: Cannot validate argument on parameter 'Property'. The argument "__CLASS" does not belong to the set "ModuleName,Namespace,OutputType,Count,HelpUri,Name,CommandType,ResolvedCommandName,DefaultParameterSet,CmdletBinding,Parameters" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. 2024-10-09T09:39:45.586+0200 DEBUG (Worker-Expedited:PowershellProbe-ffc515cb87859210ad9c624d8bbb3557) [PowerConsole:239] execute(& { fetchMultipleWMI -wmi "false" -output_format "json" -WMI_FetchData "root\virtualization\v2\Msvm_ComputerSystem.Name,HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/Domain,HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/Hostname,root\MSCluster\MSCluster_Resource.PrivateProperties,root\MSCluster\MSCluster_Resource.Name,root\MSCluster\MSCluster_Node.Name,root\MSCluster\MSCluster_Cluster.Name,root\MSCluster\MSCluster_ClusterToResource.GroupComponent,root\MSCluster\MSCluster_ClusterToResource.PartComponent,root\MSCluster\MSCluster_ClusterToNode.Antecedent,root\MSCluster\MSCluster_ClusterToNode.Dependent,root\virtualization\Msvm_ComputerSystem.Name,root\MSCluster\MSCluster_Resource.Type,Win32_ComputerSystem.Domain,Win32_ComputerSystem.Name,Win32_OperatingSystem.Caption,Win32_OperatingSystem.Version" ; } | Out-String | ForEach-Object { [Console]::WriteLine($_) }), command id: d648edb1-b02d-4a71-a0cc-2d5dd10a0d17 2024-10-09T09:39:45.601+0200 DEBUG (PowerConsole-ffc515cb87859210ad9c624d8bbb3557>stderr) [PowerConsoleStreamGobblerErr:57] STDERR d648edb1-b02d-4a71-a0cc-2d5dd10a0d17: -----START OF STDERR----- 2024-10-09T09:39:45.602+0200 DEBUG (PowerConsole-ffc515cb87859210ad9c624d8bbb3557>stdout) [PowerConsoleStreamGobblerStd:45] STDOUT d648edb1-b02d-4a71-a0cc-2d5dd10a0d17: -----START OF STDOUT----- 2024-10-09T09:39:46.337+0200 DEBUG (PowerConsole-ffc515cb87859210ad9c624d8bbb3557>stderr) [PowerConsoleStreamGobblerErr:73] STDERR d648edb1-b02d-4a71-a0cc-2d5dd10a0d17: Cannot validate argument on parameter 'Property'. The argument "__CLASS" does not belong to the set "ModuleName,Namespace,OutputType,Count,HelpUri,Name,CommandType,ResolvedCommandName,DefaultParameterSet,CmdletBinding,Parameters" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. 2024-10-09T09:39:46.337+0200 DEBUG (PowerConsole-ffc515cb87859210ad9c624d8bbb3557>stderr) [PowerConsoleStreamGobblerErr:73] STDERR d648edb1-b02d-4a71-a0cc-2d5dd10a0d17: + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException 2024-10-09T09:39:46.337+0200 DEBUG (PowerConsole-ffc515cb87859210ad9c624d8bbb3557>stderr) [PowerConsoleStreamGobblerErr:73] STDERR d648edb1-b02d-4a71-a0cc-2d5dd10a0d17: + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,JEAExecute-Script Steps to Reproduce 1. Download the attachments from this KB: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0965705 2. Configure your MID to use the JEAv2 endpoint, set up the certificates, and exchange them between the MID and the target Windows server 3. Run Quick Discovery and you will face the error in the WMI: Classify:
The problem lies in the OOTB script 'WMIFetch.psm1' and the 'jea_disco_v2.psrc' file. In the script, instead of using the proper function call 'Select-Object', an alias called 'select' is used. This is a (legacy) alias that exists in Windows. According to Microsoft best practices, it is highly discouraged to use these aliases, as a slew of problems can arise with the use of it. One of them we just witnessed. A Scriptblock is created in the function 'Get-MultipleWMIDataAsScript' within 'WMIFetch.psm1'. This Scriptblock is created by first defining a function called 'printValues' and then appending a number of PowerShell commands starting with gwmi (which again is an alias, instead of the proper 'Get-WmiObject' command) to it, the output of which is piped through to the 'select' command to select certain properties of the resulting Object. As mentioned in the JEA Role Capabilities article linked in the 'jea_disco_v2.psrc' file, the Select-Object command cannot be run in custom functions. Hence the alias is defined in the psrc file. The problem is, that this alias will not work for any other command than 'Select-Object'. Although 'select' itself is an alias for this command, it will not be recognized as such by the role capabilities file and will thus only get translated by the Windows Alias system to 'Select-Object'. This will then fail to execute as we are still in the custom function. In short, the suggestion is to use proper PowerShell commands and not rely on aliases where possible. The customer can fix the problem by adding a second alias definition for the command 'select', giving it the same value as the 'Select-Object' alias, which is 'Microsoft.PowerShell.Utility\Select-Object'.
PRB1822075
Click on a version to see all relevant bugs
ServiceNow Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.