02-23-2021 03:04 PM
03-11-2021 06:39 PM
We are not allowed to interface outside lansweeper
SELECT *
FROM
( SELECT
oldPC.PairNo,
oldPC.oldAssetName,
oldPC.SoftwarePublisher AS oldSoftwarePublisher,
oldPC.SoftwareName AS oldSoftwareName,
oldPC.SoftwareVersion AS oldSoftwareVersion,
newPC.newAssetName,
newPC.SoftwarePublisher AS newSoftwarePublisher,
newPC.SoftwareName AS newSoftwareName,
newPC.SoftwareVersion aS newSoftwareVersion
FROM
( SELECT
PCPairs.PairNo,
PCPairs.oldAssetName,
PCSoftware.SoftwarePublisher,
PCSoftware.SoftwareName,
PCSoftware.SoftwareVersion
FROM
PCPairs
LEFT JOIN PCSoftware ON PCSoftware.AssetName = PCPairs.oldAssetName) AS oldPC
LEFT JOIN
( SELECT
PCPairs.PairNo,
PCPairs.newAssetName,
PCSoftware.SoftwarePublisher,
PCSoftware.SoftwareName,
PCSoftware.SoftwareVersion
FROM
PCPairs
LEFT JOIN PCSoftware ON PCSoftware.AssetName = PCPairs.newAssetName
) AS newPC ON newPC.PairNo = oldPC.PairNo
AND newPC.SoftwarePublisher = oldPC.SoftwarePublisher
AND newPC.SoftwareName = oldPC.SoftwareName
UNION ALL
( SELECT
newPC.PairNo,
oldPC.oldAssetName,
oldPC.SoftwarePublisher AS oldSoftwarePublisher,
oldPC.SoftwareName AS oldSoftwareName,
oldPC.SoftwareVersion AS oldSoftwareVersion,
newPC.newAssetName,
newPC.SoftwarePublisher AS newSoftwarePublisher,
newPC.SoftwareName AS newSoftwareName,
newPC.SoftwareVersion aS newSoftwareVersion
FROM
( SELECT
PCPairs.PairNo,
PCPairs.oldAssetName,
PCSoftware.SoftwarePublisher,
PCSoftware.SoftwareName,
PCSoftware.SoftwareVersion
FROM
PCPairs
LEFT JOIN PCSoftware ON PCSoftware.AssetName = PCPairs.oldAssetName
) AS oldPC
RIGHT JOIN
( SELECT
PCPairs.PairNo,
PCPairs.newAssetName,
PCSoftware.SoftwarePublisher,
PCSoftware.SoftwareName,
PCSoftware.SoftwareVersion
FROM
PCPairs
LEFT JOIN PCSoftware ON PCSoftware.AssetName = PCPairs.newAssetName
) AS newPC ON newPC.PairNo = oldPC.PairNo
AND newPC.SoftwarePublisher = oldPC.SoftwarePublisher
AND newPC.SoftwareName = oldPC.SoftwareName
WHERE
oldPC.oldAssetName IS NULL
)
) AS FakeFullJoin
ORDER BY
PairNo,
IIF(oldSoftwarePublisher IS NULL, newSoftwarePublisher, oldSoftwarePublisher),
IIF(oldSoftwareName IS NULL, newSoftwareName, oldSoftwareName);
03-23-2021 11:36 AM
RC62N wrote:We are not allowed to interface outside lansweeper
Is there anything stopping you exporting from LANSweeper and massaging the results elsewhere? MS Access isn't the most elegant thing to work with, but it can be made to do the job, for example.
Create a table to mimic the #PCPairs temporary table.
Table: PCPairsPopulate it with the names of your old/new PC pairs.
- PairNo: AutoNumber
- oldAssetName: Text(255)
- newAssetName: Text(255)
Run a report from LANSweeper for your old and new PCs. Include tblAssets.AssetName, tblSoftwareUni.SoftwarePublisher, tblSoftwareUni.SoftwareName, tblSoftware.SoftwareVersion. Filter out the fluff you're not interested in seeing compared. Export it to CSV or Excel or whatever you want to work with. Import that into your Access database.
Table: PCSoftwareMS Access doesn't support FULL JOIN, so you'll have to fake that.
- AssetName: Text(255)
- SoftwarePublisher: Text(255)
- SoftwareName: Text(255)
- SoftwareVersion: Text(255)
Create a query:SELECT *
FROM
( SELECT
oldPC.PairNo,
oldPC.oldAssetName,
oldPC.SoftwarePublisher AS oldSoftwarePublisher,
oldPC.SoftwareName AS oldSoftwareName,
oldPC.SoftwareVersion AS oldSoftwareVersion,
newPC.newAssetName,
newPC.SoftwarePublisher AS newSoftwarePublisher,
newPC.SoftwareName AS newSoftwareName,
newPC.SoftwareVersion aS newSoftwareVersion
FROM
( SELECT
PCPairs.PairNo,
PCPairs.oldAssetName,
PCSoftware.SoftwarePublisher,
PCSoftware.SoftwareName,
PCSoftware.SoftwareVersion
FROM
PCPairs
LEFT JOIN PCSoftware ON PCSoftware.AssetName = PCPairs.oldAssetName) AS oldPC
LEFT JOIN
( SELECT
PCPairs.PairNo,
PCPairs.newAssetName,
PCSoftware.SoftwarePublisher,
PCSoftware.SoftwareName,
PCSoftware.SoftwareVersion
FROM
PCPairs
LEFT JOIN PCSoftware ON PCSoftware.AssetName = PCPairs.newAssetName
) AS newPC ON newPC.PairNo = oldPC.PairNo
AND newPC.SoftwarePublisher = oldPC.SoftwarePublisher
AND newPC.SoftwareName = oldPC.SoftwareName
UNION ALL
( SELECT
newPC.PairNo,
oldPC.oldAssetName,
oldPC.SoftwarePublisher AS oldSoftwarePublisher,
oldPC.SoftwareName AS oldSoftwareName,
oldPC.SoftwareVersion AS oldSoftwareVersion,
newPC.newAssetName,
newPC.SoftwarePublisher AS newSoftwarePublisher,
newPC.SoftwareName AS newSoftwareName,
newPC.SoftwareVersion aS newSoftwareVersion
FROM
( SELECT
PCPairs.PairNo,
PCPairs.oldAssetName,
PCSoftware.SoftwarePublisher,
PCSoftware.SoftwareName,
PCSoftware.SoftwareVersion
FROM
PCPairs
LEFT JOIN PCSoftware ON PCSoftware.AssetName = PCPairs.oldAssetName
) AS oldPC
RIGHT JOIN
( SELECT
PCPairs.PairNo,
PCPairs.newAssetName,
PCSoftware.SoftwarePublisher,
PCSoftware.SoftwareName,
PCSoftware.SoftwareVersion
FROM
PCPairs
LEFT JOIN PCSoftware ON PCSoftware.AssetName = PCPairs.newAssetName
) AS newPC ON newPC.PairNo = oldPC.PairNo
AND newPC.SoftwarePublisher = oldPC.SoftwarePublisher
AND newPC.SoftwareName = oldPC.SoftwareName
WHERE
oldPC.oldAssetName IS NULL
)
) AS FakeFullJoin
ORDER BY
PairNo,
IIF(oldSoftwarePublisher IS NULL, newSoftwarePublisher, oldSoftwarePublisher),
IIF(oldSoftwareName IS NULL, newSoftwareName, oldSoftwareName);
03-01-2021 09:01 AM
02-26-2021 06:30 PM
CREATE Table #PCPairs
( PairNo Int NOT NULL IDENTITY,
oldAssetID Int NOT NULL,
newAssetID Int NOT NULL
)
/*
Run yourself a list of assets to pull the AssetID values of the old and new machines.
*/
INSERT INTO #PCPairs (oldAssetID, newAssetID)
VALUES
(1419, 15829),
(1411, 10871) -- etc.
SELECT
IsNull(oldSoftware.PairNo, newSoftware.PairNo) AS PairNo,
oldSoftware.AssetID,
oldSoftware.AssetName,
oldSoftware.SoftwarePublisher,
oldSoftware.SoftwareName,
oldSoftware.SoftwareVersion,
newSoftware.AssetID,
newSoftware.AssetName,
newSoftware.SoftwarePublisher,
newSoftware.SoftwareName,
newSoftware.SoftwareVersion,
CASE
WHEN oldSoftware.AssetID IS NULL OR newSoftware.AssetID IS NULL THEN '-'
WHEN oldSoftware.SoftwareVersion = newSoftware.SoftwareVersion THEN 'same'
WHEN oldSoftware.SoftwareVersion > newSoftware.SoftwareVersion THEN 'OLD > new'
WHEN oldSoftware.SoftwareVersion < newSoftware.SoftwareVersion THEN 'NEW > old'
ELSE '??' -- shouldn't happen, but cover all bases
END AS VersionDifference
FROM
( SELECT
#PCPairs.PairNo,
tblAssets.AssetID,
tblAssets.AssetName,
tblSoftwareUni.SoftwarePublisher,
tblSoftwareUni.SoftwareName,
tblSoftware.SoftwareVersion
FROM
#PCPairs
INNER JOIN tblAssets ON tblAssets.AssetID = #PCPairs.oldAssetID
INNER JOIN tblSoftware ON tblSoftware.AssetID = tblAssets.AssetID
INNER JOIN tblSoftwareUni ON tblSoftwareUni.SoftID = tblSoftware.SoftID) AS oldSoftware
FULL JOIN ( SELECT
#PCPairs.PairNo,
tblAssets.AssetID,
tblAssets.AssetName,
tblSoftwareUni.SoftwarePublisher,
tblSoftwareUni.SoftwareName,
tblSoftware.SoftwareVersion
FROM
#PCPairs
INNER JOIN tblAssets ON tblAssets.AssetID = #PCPairs.newAssetID
INNER JOIN tblSoftware ON tblSoftware.AssetID = tblAssets.AssetID
INNER JOIN tblSoftwareUni ON tblSoftwareUni.SoftID = tblSoftware.SoftID) AS newSoftware
ON newSoftware.PairNo = oldSoftware.PairNo
AND newSoftware.SoftwarePublisher = oldSoftware.SoftwarePublisher
AND newSoftware.SoftwareName = oldSoftware.SoftwareName
ORDER BY
IsNull(oldSoftware.PairNo, newSoftware.PairNo),
IsNull(oldSoftware.SoftwarePublisher, newSoftware.SoftwarePublisher),
IsNull(oldSoftware.SoftwareName, newSoftware.SoftwareName)
DROP Table #PCPairs
02-26-2021 11:56 AM
02-25-2021 09:23 PM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblSoftwareUni.softwareName As Software,
tblSoftware.softwareVersion As Version,
tblSoftwareUni.SoftwarePublisher As Publisher,
tblSoftware.Lastchanged,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblSoftware On tblAssets.AssetID = tblSoftware.AssetID
Inner Join tblSoftwareUni On tblSoftwareUni.SoftID = tblSoftware.softID
Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Inner Join tblState On tblState.State = tblAssetCustom.State
Where tblSoftwareUni.softwareName Like 'Adobe Acrobat Reader DC' And
tblSoftware.softwareVersion < '21.001.20138'
Order By tblAssets.Domain,
tblAssets.AssetName,
Software
02-25-2021 11:49 AM
02-23-2021 10:22 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now