WMI4Java icon indicating copy to clipboard operation
WMI4Java copied to clipboard

WMI4Java Filters & WMIObject "MDM_DevDetail_Ext01"

Open ReneKofler opened this issue 3 years ago • 0 comments

Hi @profesorfalken , I have 2 Problems with following example:

  • the 4k Hash is only 100 characters long
  • I cannot get the filters to work :(

here is my code

String hash= WMI4Java.get()
                .namespace("root/cimv2/mdm/dmmap")
                .filters(Arrays.asList("InstanceID -eq \"Ext\"","ParentID -eq \"./DevDetail\""))
                .getWMIObject("MDM_DevDetail_Ext01")
                .get("DeviceHardwareData");

If I leave out the filters it still works on my machine but with a reduced hashKey. I also tried the filters in various ways e.g. .filters(Arrays.asList("InstanceID='Ext'","ParentID='./DevDetail'"))

The hashkey seems to work with getRawWMIObjectOutput, but then I have to do the parsing myself.

Since this command only works on elevated Powershell, it is not that easy to test, since I cannot debug it. Can I elevate the internally used JPowershell as well?

Thanks, Rene

ReneKofler avatar Nov 28 '22 13:11 ReneKofler