I have created the following report when I was asked to write an altiris report, to find a list of software installed on the given user’s PCs.
I was given a list of users as input to the report. Now I have to find out the list of software in each user’s PC. There are actually two reports in this.
SELECT DISTINCT (PU.[User]), vComputer.[Name] AS 'Machine Name', ACI.[Domain] AS 'Domain' FROM vComputer INNER JOIN [inv_aex_ac_primary_user] PU ON PU._ResourceGuid = vComputer.Guid JOIN [Inv_AeX_AC_Identification] ACI ON ACI.[_ResourceGuid] = vComputer.Guid WHERE PU.[Month] = datename(month, getdate()) AND UPPER(PU.[User]) IN (Enter_usernames_in_single_quotes_SeparatedBy_comma) ORDER BY PU.[User]
SELECT DISTINCT(vComputer.[Name]) AS 'Machine Name', ARP.[Name] AS 'Application Name’,ARP.[Version] FROM vComputer INNER JOIN [Inv_AeX_OS_Add_Remove_Programs] ARP ON ARP.[_ResourceGuid] = vComputer.Guid WHERE UPPER(vComputer.[Name]) IN (Enter_machinenames_in_single_quotes_SeparatedBy_comma) ORDER BY vComputer.[Name]
If we combine the above reports, will get a report that displays [Primary User/Machine Name/List of software installed] on the machine.
SELECT DISTINCT(PU.[User]), vComputer.[Name] AS 'Machine Name', ACI.[Domain] AS 'Domain', ARP.[Name] AS 'Application Name', ARP.[Version] FROM vComputer INNER JOIN inv_aex_ac_primary_user PU ON PU._ResourceGuid = vComputer.Guid JOIN [Inv_AeX_AC_Identification] ACI ON ACI.[_ResourceGuid] = vComputer.Guid JOIN [Inv_AeX_OS_Add_Remove_Programs] ARP ON ARP.[_ResourceGuid] = ACI.[_ResourceGuid] WHERE PU.[Month] = datename(month, getdate()) AND UPPER(PU.[User]) IN (Enter_usernames_in_single_quotes_SeparatedBy_comma) ORDER BY PU.[User]
AND UPPER(PU.[User]) IN (dfussell)
That is what I was looking for. Excellent tip... I could not find why it could parse the single quotes, your tip helped to resolve my report.
thank you.
Art
WHERE .... IN (%_UserList%)