WMI: Difference between revisions

From WikiWiki
Jump to navigation Jump to search
No edit summary   (change visibility)
No edit summary   (change visibility)
Line 10: Line 10:
| Example || Get all Windows Desktop OS higher then Win7 || select * from Win32_OperatingSystem where (Version like "10.%" or Version >="6.1") and ProductType = "1" ||
| Example || Get all Windows Desktop OS higher then Win7 || select * from Win32_OperatingSystem where (Version like "10.%" or Version >="6.1") and ProductType = "1" ||
|-
|-
| Example || Select all computer not Domain Controller ||  * SELECT * FROM Win32_ComputerSystem Where DomainRole <> 4 AND DomainRole <> 5
| Example || Select all computer not Domain Controller ||   
* SELECT * FROM Win32_ComputerSystem Where DomainRole <> 4 AND DomainRole <> 5
* select * from Win32_OperatingSystem where (ProductType = "3")   
* select * from Win32_OperatingSystem where (ProductType = "3")   
|| * https://technet.microsoft.com/en-us/library/ee198796.aspx
||
* https://technet.microsoft.com/en-us/library/ee198796.aspx
* http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-wmi-filters/
* http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-wmi-filters/
|-
|-

Revision as of 15:40, 25 January 2016

Some WMI filters



Header text Header text Header text References
Example Get all Windows Desktop OS higher then Win7 select * from Win32_OperatingSystem where (Version like "10.%" or Version >="6.1") and ProductType = "1"
Example Select all computer not Domain Controller
  • SELECT * FROM Win32_ComputerSystem Where DomainRole <> 4 AND DomainRole <> 5
  • select * from Win32_OperatingSystem where (ProductType = "3")
Example Example Example


Manually test WMI

wbemtest

  • open
  • connect
  • query
  • if result == blank, query failed, if result holds hostname, query succedded