→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎01-07-2015 06:34 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssets.Username,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where tblAssets.AssetID Not In (Select Top 1000000 tblAssets.AssetID
From tblAssets Inner Join tblRegistry On tblAssets.AssetID =
tblRegistry.AssetID
Where tblRegistry.Regkey Like '%SoftwareMicrosoftDeployment 4' And
tblRegistry.Valuename = 'Task Sequence Name') And tblAssets.Lastseen <> ''
And tsysAssetTypes.AssetTypename = 'windows' And tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName
Solved! Go to Solution.
‎01-07-2015 10:59 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssets.Username,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblRegistry On tblRegistry.AssetID = tblAssets.AssetID And
tblRegistry.Regkey Like '%Software\Microsoft\Deployment 4' And
tblRegistry.Valuename = 'Task Sequence Name'
Where tblAssets.AssetName Not Like 'SGS%' And tblAssets.AssetName Not Like
'SGV%' And tblAssets.Lastseen <> '' And tblAssetCustom.State = 1 And
tblRegistry.AssetID Is Null And tblAssets.Assettype = -1
Order By tblAssets.Domain,
tblAssets.AssetName
‎01-08-2015 04:33 PM
‎01-07-2015 10:59 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssets.Username,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblRegistry On tblRegistry.AssetID = tblAssets.AssetID And
tblRegistry.Regkey Like '%Software\Microsoft\Deployment 4' And
tblRegistry.Valuename = 'Task Sequence Name'
Where tblAssets.AssetName Not Like 'SGS%' And tblAssets.AssetName Not Like
'SGV%' And tblAssets.Lastseen <> '' And tblAssetCustom.State = 1 And
tblRegistry.AssetID Is Null And tblAssets.Assettype = -1
Order By tblAssets.Domain,
tblAssets.AssetName
‎01-07-2015 10:20 PM
SELECT Top 1000000
tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssets.Username,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model
FROM
tblAssets
INNER JOIN tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
INNER JOIN tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
LEFT JOIN tblRegistry ON tblRegistry.AssetID = tblAssets.AssetID
AND tblRegistry.Regkey Like '%SoftwareMicrosoftDeployment 4'
AND tblRegistry.Valuename = 'Task Sequence Name'
WHERE
tblAssetCustom.State = 1
AND tblRegistry.AssetID IS NULL --key not found
AND tblAssets.AssetType = -1 --Windows
And tblAssets.Lastseen <> ''
AND ( tblAssets.AssetName LIKE 'SGS%'
OR tblAssets.AssetName LIKE 'SGV%'
)
ORDER BY
tblAssets.Domain,
tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now