Does anyone have a sql report query for manage install details view
I want to display a report like manage install detail when show all manage install task, and add a column for installed date. I tried to find the table but haven't found it yet
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
JasonEgg
3 years ago
So "install date" is a bit tricky: it doesn't exist in the tables "MI" nor "MI_ATTEMPT". AFAIK, the only way to get a good idea of the actual "install date" is to use asset history to see the first time an app was detected. However, you only retain that information if you configured the settings in "Settings" > "History" > "Assets" (under "Subscriptions) > "Computer"
That being said, here's a query that will get you some of the info:
SELECTS.DISPLAY_NAME as "SOFTWARE_TITLE",
CASE
WHEN J.SOFTWARE_ID IS NULL THEN 'NOT INSTALLED'
ELSE 'INSTALLED'
END AS 'STATUS',
MACHINE.NAME,
MACHINE.USER_LOGGED,
MACHINE.IP,
MACHINE.LAST_SYNC,
A.ATTEMPT_COUNT
FROM
MI_ATTEMPT A
JOIN
MI ON MI.ID = A.MI_ID
JOIN
MACHINE ON A.MACHINE_ID = MACHINE.ID
JOIN
SOFTWARE S ON S.ID = MI.SOFTWARE_ID
LEFT JOIN
MACHINE_SOFTWARE_JT J ON J.MACHINE_ID = MACHINE.ID
AND J.SOFTWARE_ID = MI.SOFTWARE_ID
WHERE
MI.ENABLED != 0