
jessese asked a question.
I've created a SQL query to get a list of all systems that haven't been inventoried in the last 90 days that are currently "Active" and also get a list of all assets that have been recently inventoried that are currently marked as "Ignored". We are just using the default database scheme for the FNMSCompliance database. My question would be do I need to export that query to a XML file to then re-import the information into I assume is the "Computer" section. Currently the query would change the "1" for new to "2" for Ignored and vice versa depending which part of the query. If I need to export to an XML how do I modify the script for that to work.
SELECT
ComputerName AS Hostname,
'2' AS Status
FROM ComplianceComputer c
WHERE c.ComplianceComputerStatusID = 1
AND c.InventoryDate < DATEADD(DAY, -90, GETDATE())
AND c.ComputerName NOT LIKE 'snapshot%'
AND c.ComputerName NOT LIKE 'localhost'
UNION ALL
SELECT
ComputerName AS Hostname,
'1' AS Status
FROM ComplianceComputer c
WHERE c.ComplianceComputerStatusID = 2
AND c.InventoryDate > DATEADD(DAY, -90, GETDATE())
AND c.ComputerName NOT LIKE 'snapshot%'
AND c.ComputerName NOT LIKE 'localhost'
The reason for hard coding the value for the Status is so that updated value could be later re-imported back into the database overwriting the existing value. Thus releasing the licenses that are currently being consumed by the outdated assets. I would be extremely grateful if someone would provide this as a functional adapter so that I could see exactly how you would do it. But any assistance you can provide would be great.
@jessese​
I must admit that I don't understand the use case(s) behind your question and need for a business adapter that uses SQL to hard code values into the underlying FNMSCompliance database. This isn't a good practice... A better practice would be to work against the object model if there's a need for a business adapter...
Software installed on devices with status "Ignored" do not contribute in the license compliance calculations, please refer to Ignoring an Inventory Record.
Thanks,
John Sorensen