Link between SOFTWARE and SAM_VIEW_DISCOVERED_SOFTWARE tables
Hi,
I need to find out if discovered software is installed or not and if there is a link between the 2 tables.
The problem with KACE is that on the discovered software (SAM_VIEW_DISCOVERED_SOFTWARE) table it contains EDITION and LICENSE_TYPE fields while on the installed software (SOFTWARE) table it does not.
Is there maybe a JT (join table) that links SOFTWARE.ID to SAM_VIEW_DISCOVERED_SOFTWARE.ID?
I need to know if installed software needs to be licensed or not for our MicroSoft SQL Server/Express count.
Then KACE also made a mistake in their classification of SQL server 2014 Express where they indicated that it's supposed to be Licensed in the SAM_VIEW_DISCOVERED_SOFTWARE table! lol NOT!
Then first prize would be if I can then also have a JT/link from SOFTWARE to the NTSERVICE table where I can see if the sqlservr.exe is running or not so that I can contact the owners to have the ones that's been stopped uninstalled.
Tnx
Henk Breytenbach
Answers (3)
select M.NAME, M.IP, SMS.NAME, SMS.EDITION, N.* from SAM_VIEW_MACHINE_DISCOVERED_SOFTWARE SMSleft join MACHINE M on M.ID = SMS.MACHINE_IDleft join MACHINE_NTSERVICE_JT MN on MN.MACHINE_ID = M.IDleft join NTSERVICE N on N.ID = MN.NTSERVICE_IDwhere N.DISPLAY_NAME like '%SQL Server%'and N.STATUS = 'SERVICE_RUNNING'
Comments:
-
Hi,
Tnx but this is data related and not joining of tables.
In the SAM_VIEW_DISCOVERED_SOFTWARE.ID field I get a value of APP4772 for 'SQL Server 2008 R2 Standard' but that software id does not exist in the SOFTWARE.ID field.
The SAM tables contains discovered software and the MACHINE_SOFTWARE_JT contains installed programs but they each have their own set of software codes! How stupid! lol
The NTSERVICE table tells me whether sqlservr.exe is running or not, but I cannot get the software id from the table to determine whether it's a licensed version or freeware. I can only join to MACHINE from it.
I need to report to MicroSoft how many installed SQL instances we have so that we can check if our licensing is in order.
I want to write a script that I don't have to maintain every time a new version of sql server is released.
KACE doesn't have and ERD that I know of nor can their support people help me.
This is most probably the worst packages available on the market and it's worrying that Dell bought it and does nothing to fix it.... - Henk Breytenbach 9 years ago -
The ideal would be to get the following for SOFTWARE, MACHINE_SOFTWARE_JT, MACHINE
select distinct A.ID, A.NAME, A.PRODUCT_NAME, A.MAJOR_VERSION, A.EDITION, A.MACHINE_ID, A.LICENSE_TYPE, B.USER, B.NAME, B.CS_MODEL, B.BIOS_SERIAL_NUMBER
from SAM_VIEW_MACHINE_DISCOVERED_SOFTWARE A
left join ORG1.MACHINE B on A.MACHINE_ID = B.ID
where A.license_type = 'Licensed'
and A.product_name = 'sql server'; - Henk Breytenbach 9 years ago
SELECT DS.*, M.NAME FROM ORG1.SAM_VIEW_DISCOVERED_SOFTWARE DS
JOIN SAM_MACHINE_JT JT on JT.SAM_CATALOG_ID = DS.ID
JOIN MACHINE M on M.ID = JT.MACHINE_ID
WHERE DS.NAME like "%SQL Server%"
SELECT DS.*, M.NAME FROM ORG1.SAM_VIEW_DISCOVERED_SOFTWARE DS
JOIN SAM_MACHINE_JT JT on JT.SAM_CATALOG_ID = DS.ID
JOIN MACHINE M on M.ID = JT.MACHINE_ID
WHERE DS.PRODUCT_NAME = "SQL Server"
Comments:
-
Hi,
This doesn't help me at all as I need the join with the SOFTWARE table.
If I look at a specific machine in KACE there are discovered and installed software lists that are way different.
SAM shows discovered and MACHINE_SOFTWARE shows installed, but the problem is that it does not contain all the SAM fields eg. License Type.
I don't want to pay license fees on a product that's not installed.
I know that SAM_VIEW_DISCOVERED_SOFTWARE has a field called INSTALLED_ON that gives the number of 'installations', but it's not physical installations. The software is in a directory/external drive connected to that machine and not necessarily installed.
If you go to add/remove programs they don't always appear there.
In short installed software is a subset of discovered software, but there is no link in KACE between the 2 and they also don't have consistent classifications. - Henk Breytenbach 9 years ago
select MACHINE.NAME, SAM_MACHINE_JT.*, SC.*
from MACHINE
INNER JOIN SAM_MACHINE_JT ON
MACHINE.ID = SAM_MACHINE_JT.MACHINE_ID
AND MAX_VERSION = 1
INNER JOIN CATALOG.SAM_CATALOG SC ON
SC.ID = SAM_MACHINE_JT.SAM_CATALOG_ID;
Now that just lists all the stuff on a machine matched up to the software catalog and the max version at that. The K1 identifies all executables on a box so it can show multiple versions installed. Now if you wanted to get fancy and join back against running processes and only for SQL Server it would look something like the following.
select MACHINE.NAME, SAM_MACHINE_JT.*, SC.*
from MACHINE
INNER JOIN SAM_MACHINE_JT ON
MACHINE.ID = SAM_MACHINE_JT.MACHINE_ID
AND MAX_VERSION = 1
INNER JOIN CATALOG.SAM_CATALOG SC ON
SC.ID = SAM_MACHINE_JT.SAM_CATALOG_ID
inner join MACHINE_NTSERVICE_JT ON
MACHINE.ID = MACHINE_NTSERVICE_JT.MACHINE_ID
INNER JOIN NTSERVICE ON
NTSERVICE.ID = MACHINE_NTSERVICE_JT.NTSERVICE_ID
WHERE SC.NAME LIKE '%SQL SERVER%' AND
NTSERVICE.DISPLAY_NAME LIKE '%SQL SERVER';
Comments:
-
Tnx, but you guys are all missing the point. I don't want to use the SAM tables as they are giving discovered software and not installed software. - Henk Breytenbach 9 years ago