Useful WMI Queries
-
I suggest we use this topic to update it with useful WMI queries. My interest is in IIS and SQL. I am having luck with IIS but not SQL, ie a logsize for a particular database is becoming difficult. My set that I can offer, and more will follow are as follows.
iis anoymous users
WMI.Query(root\cimv2,select * from Win32_PerfFormattedData_W3SVC_WebService, TotalAnonymousUsers)iis service
WMI.Query(root\microsoftiisv2,select * from iiswebservice,state)nlb status - 1008 shows all is ok - more details here http://msdn.microsoft.com/en-us/library/cc307934(VS.85).aspx
WMI.Query(root\MicrosoftNLB,select * from MicrosoftNLB_Node, StatusCode)SQL Cache Memory KB
WMI.Query(root\CIMV2,select * from Win32_PerfFormattedData_MSSQLSERVER_SQLServerMemoryManager,SQLCacheMemoryKB)SQL Transactions
WMI.Query(root\CIMV2,select * from Win32_PerfFormattedData_MSSQLSERVER_SQLServerTransactions, Transactions)iis bytes received
WMI.Query(root\cimv2,select * from Win32_PerfFormattedData_W3SVC_WebService, TotalBytesReceived)iis bytes sent
WMI.Query(root\cimv2,select * from Win32_PerfFormattedData_W3SVC_WebService, TotalBytesSent)iis current connections
WMI.Query(root\cimv2,select * from Win32_PerfFormattedData_W3SVC_WebService, CurrentConnections)available memory
WMI.Query(root\cimv2,select * from Win32_perfRawData_PerfOS_Memory,AvailableMbytes) -
Temperature of CPU's thermal zone:
WMI.Query(root\WMI,"select * from MSAcpi_ThermalZoneTemperature",CurrentTemperature)This temperature is in tenths of degrees Kelvin, so you need to add transformation script:
for Celsius:($1-2730)/10
for Fahrenheit:((($1-2730)/10)*1.8)+32
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login