sqlwqlsccm

WQL Query and displaying custom fields


I'm running a WQL Query from SCCM to grab a list of computers with one of two applications installed. I'd like to display the name of the offending application in a column alongside the computer name. Do you know of an easy way to do this?

Another way to accomplish this would be multiple Select Statements, of course.

My query code:

    select SMS_G_System_SYSTEM.ResourcelD From SMS_R_System inner
    join SMS_G_System_SYSTEM on SMS_G_System_5VSTEM.ResourcelD =
    SMS_R_System.ResourcelD inner join
    SMS_G_System_ADD_REMOVE_PROGRAMS on
    SMS_G_System_ADD_REMOVE_PROGRAM5. ResourcelD =
    SMS_R_System. Resourceld where
    (SMS_G_System_ADD_REMOVE_PROGRAMS. DisplayName like "%Chrome%") or

    (SMS_G_System_ADD_REMOVE_PROGRAMS,DisplayName like "%Firefox%”)

Solution

  • To add a column you add it to your select.

    SELECT 
    SMS_R_System.Netbios_Name0 as 'Name',
    SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName as 'Software'
    FROM
    ....
    

    etc

    Let me know if this helps...