locked
WMI to query laptop, but not virtual machine RRS feed

  • Question

  • Hi, 

    I posted this int he Systems conf manager, but I think it would be better suited here. 

    I am currently using a WMI to query all mobile machines using this statement - select * from win32_computersystem where pcsystemtype = 2

    The query works fine but is also picking up virtual machines running on laptops. I want to exclude the task form running on machines running on these virtual machines. Is there anything way of appending the original statement to exclude the virtual machines. Most virtual platforms include the word 'virtual' in the model description (VMWare Virtual Platform, Virtual Machine, virtualbox). I don't know id this would work, but would something like select * from win32_computersystem where pcsystemtype = 2 (and where Model does NOT include "virtual") be possible? 

    Thanks. 


    JC

    Wednesday, April 1, 2015 7:51 AM

Answers

  •  select * from win32_computersystem where pcsystemtype = 2 and not model like '%virtual%'
    • Marked as answer by John Couzins Wednesday, April 1, 2015 1:45 PM
    Wednesday, April 1, 2015 9:01 AM

All replies

  •  select * from win32_computersystem where pcsystemtype = 2 and not model like '%virtual%'
    • Marked as answer by John Couzins Wednesday, April 1, 2015 1:45 PM
    Wednesday, April 1, 2015 9:01 AM
  • Works perfect. Massive thanks. 

    JC

    Wednesday, April 1, 2015 1:45 PM