Client Automation - All Versions
DECLARE @PackageName AS nvarchar(129), @PackageVersion AS nvarchar(129), @PackageProcedure AS nvarchar(129)
SET @PackageName='PKG'
SET @PackageVersion='16.0'
SET @PackageProcedure='install'
SELECT M.agent_name [Computer Name],
M.ip_address [Computer IP Address],
R.itemname [Package Name],
R.itemversion [Package Version],
P.itemname [Procedure Name],
dateadd(ss, completiontime+ datediff(ss,getutcdate(),getdate()), convert(datetime,'19700101')) [Install Time],
H.label 'Source Used',
M2.ip_address'Source IP Address'
FROM usd_applic A
LEFT JOIN usd_actproc P ON A.actproc=P.objectid
LEFT JOIN usd_rsw R ON P.rsw=R.objectid
LEFT JOIN ca_agent M ON A.target=M.object_uuid
LEFT JOIN ca_discovered_hardware H ON A.uuid2=H.host_uuid
LEFT JOIN ca_agent M2 ON M2.object_uuid=H.dis_hw_uuid
WHERE A.installation=a.objectid and A.uninstallstate<>2 and P.itemname<>'delivery proc' and A.status=9
AND R.itemname=@PackageName and R.itemversion=@PackageVersion and P.itemname=@PackageProcedure
ORDER BY [Computer Name], [Install time]