Find CPU CORE using WMI query

I want to list out the CPU Core / Processes in the system. When I have used select DeviceID from Win32_Processor, I got CPU0 as result; But I am expecting result as "CPU0,CPU1,CPU2,CPU3" since there are multiple cores. Is there any other one liner available for finding out this?Thanking you......Read more

sccm - Error while fetching null valued array columns in WQL (WMI Query Language)

I'm little new to world of WQL (WMI Query Language). I'm trying to query ConfigMgr 2012 using WQL but I'm facing an error when I try to mention the name of a column in the comma separated select clause. The error happens ONLY when the column being fetched is of array type and contains null values. It works fine if the array column has some values. The same works fine even if column is of non-array type (string,int etc) and contains null values. I've elaborated the sample queries below :When I fire following query it works well :Query # 1 : SELE...Read more

How to programmatically query if an SCCM 2012 Application is Active or Retired

We have an application that integrates with SCCM 2012 and saves custom SCCM applications to SCCM.The problem I am having is that attempting to save one of our custom applications when the SCCM administrator has set the application to be in the retired state causes our application to fail the saving process.I'd like to be able to query the SCCM application state in order to determine before we attempt the save operation whether the given application is Active or Retired.I can find no reference to "retired" status in the SMS_Application Server WM...Read more

wmi query to get "memoryPagesPerSec "

I have worked on how to get performance counter i need to add in my requiremnet, is "memoryPagesPerSec "I have use inbuild class to get this counter, but not get the valueit is always zero, while i check in perfmon.exe, it gives some values.Can some one tell me the reason, or what is the alternate solution in WMI query to get this counter value.My current code is.... var s1 = new System.Diagnostics.PerformanceCounter("Memory", "Pages/sec"); string s2 = s1.NextValue().ToString(); Console.WriteLine("Test Memory: " + s2.ToS...Read more WMI query to string

I have a little issue with WMI query.I have to check if a certain property exists in a WMI query instance, the code i have done is:Imports System.ManagementImports System.Management.InstrumentationPublic Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim search_cpu As New ManagementObjectSearcher("SELECT * FROM Win32_Processor") Dim info_cpu As ManagementObject '= Convert.ToUInt32("search_cpu") Dim cpu_v As Integer For Each info_cpu In search_cpu.Get() If s...Read more