Hello
The columns returned by the WMI class are incomplete or unexpected. This error can indicate that the query returned a null value. Therefore the script can't continue / will throw the 0x80041017. It is possible that the Win32_Thread cannot be found or accessed on the server causing a null result.
In most cases, could be also due to an output with multiple objects (various handles) so the system can't assign the variable to one specifically, then it complains about the Invalid Query.
Please try to add a recursion on the result, such as:
$Threads = $processHandle | Foreach-Object{
Get-CimInstance -Class Win32_Thread -Filter "ProcessHandle = $_"
}
---------------------------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept as answer--