We have a requirement to delete all Virtual Machines from the ImportedVirtualMachine table which have never been inventoried by FlexNet agent. We have a script (see below) which will give us all the machines without an InventoryDate. We only currently have VMWare & HyperV devices.
select ivm.ComputerName as ImportedComputerName, ivm.virtualmachinetype,cc.computername, vm.FriendlyName, cc.InventoryDate, vm.*
from ImportedVirtualMachine ivm left join VirtualMachine vm
on ivm.uuid = vm.uuid left join compliancecomputer cc
on vm.ComplianceComputerID = cc.ComplianceComputerID
where ivm.VirtualMachineType in ('VMType.VMWare','VMType.HyperV')
and cc.computername is null
order by inventorydate
Any time we delete anything from ImportedVM table it repopulates. We're unsure which underlying table(s) we should be deleting from to ensure the results from the above query are do not repopulate.
We wish to execute this query on a regular basis to ensure we do not have a number of legacy/decomm'd machines within this table as we do currently.
May 03, 2019 10:06 AM
That is due to them still being present in the FNMS Inventory database. You would need to remove them from both the Compliance and Inventory databases.
May 03, 2019 11:53 AM
As @BradAkers has alluded do, deleting data from the Imported* tables in the compliance database normally won't do anything interesting if you don't also delete data from the underlying inventory source database: the next time an import is performed, data from the source database will simply be re-imported and cause the Imported* records to be re-created.
A pattern that you can use to delete computers in the FlexNet inventory database is as follows:
SELECT ComputerID INTO #Computer FROM dbo.Computer WHERE <insert condition to identify computers to be deleted> EXEC dbo.DeleteComputers
May 05, 2019 05:56 PM
May 08, 2019 05:55 AM
May 06, 2019 12:57 PM
Kirk,
As of 2017 R3 I want to say VMs without our full HW/SW scan data will no longer show in the FNMS WebUI. They will only exist in the DB with a status of Awaiting Inventory.
May 07, 2019 07:08 AM - edited May 07, 2019 07:24 AM