also one more thing..from v_gs_localgroupmembers0 lgm join v_gs_workstation_status ws on ws.resourceid=lgm.resourceid join v_r_system_valid sys1 on sys1.resourceid=lgm.resourceid left join v_CICurrentComplianceStatus cs on cs.resourceid=lgm.resourceid left join v_LocalizedCIProperties_SiteLoc loc on loc.ci_id=cs.ci_id where loc.displayname = 'local group members into WMI' ....
the way this is written the last left join will reduce to an inner join as you've added a filter from right table in where which will only return you records with matches in right table (v_LocalizedCIProperties_SiteLoc).If you intention is to treat it as a left join and get unmatched ones too then it should be like..from v_gs_localgroupmembers0 lgm join v_gs_workstation_status ws on ws.resourceid=lgm.resourceid join v_r_system_valid sys1 on sys1.resourceid=lgm.resourceid left join v_CICurrentComplianceStatus cs on cs.resourceid=lgm.resourceid left join v_LocalizedCIProperties_SiteLoc loc on loc.ci_id=cs.ci_id and loc.displayname = 'local group members into WMI' where lgm.type0 = 'local' and lgm.category0 = 'userAccount' and lgm.account0 not in ('Administrator','Guest') order by sys1.netbios_name0, lgm.name0, lgm.account0
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs