Here's the deal:
SELECT DISTINCT System.Name0, Programs.Version0, v_RA_System_SystemOUName.System_OU_Name0 AS OU FROM v_Add_Remove_Programs AS Programs INNER JOIN v_R_System AS System ON Programs.ResourceID = System.ResourceID INNER JOIN v_RA_System_SystemOUName ON System.ResourceID = v_RA_System_SystemOUName.ResourceID WHERE (Programs.DisplayName0 LIKE '%Microsoft Application Virtualization Desktop Client%') AND (Programs.Version0 LIKE '%4.6%')
Works great. But, because of SCCM's Database structure, each resourceID (computer) has multiple SystemOU rows-
Here is a small example of our output:
NAME VERSION SYSTEM OU
AMHPYXOEW1 4.6.0.20200 <DOMAIN>/THR WORKSTATIONS
AMHPYXOEW1 4.6.0.20200 <DOMAIN>/THR WORKSTATIONS/AMH
AMHPYXOEW1 4.6.0.20200 <DOMAIN>/THR WORKSTATIONS/AMH/COMMON DESKTOP AMH
ARLDTECOMMON 4.6.0.20200 <DOMAIN>/THR WORKSTATIONS
ARLDTECOMMON 4.6.0.20200 <DOMAIN>/THR WORKSTATIONS/TEST WORKSTATION OU
ARLDTECOMMON 4.6.0.20200 <DOMAIN>/THR WORKSTATIONS/TEST WORKSTATION OU/TEST2
I really just want the last entry: <DOMAIN>/THR WORKSTATIONS/<OU>
True, I could remove the first one <DOMAIN>/THR WORKSTATIONS by having where not <blah>, but that doesn't seem very efficient to me. Maybe i need a subquery? I don't know, and I feel like an id10t since I used to do this stuff all the time.....
Someone please help me...
Edited by Parabola, 28 January 2011 - 07:51 AM.
solved..


Sign In
Create Account


Back to top









