‎11-10-2015 02:08 AM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssetCustom.State,
tblFileVersions.Found
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblRegistry On tblAssets.AssetID = tblRegistry.AssetID
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblFileVersions On tblAssets.AssetID = tblFileVersions.AssetID
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Where (tblAssetCustom.State = 1 And tblFileVersions.Found = 1 And
tblFileVersions.FilePathfull = 'C:\program files\dell\dcct.log' And
tblRegistry.Regkey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Dell' And
tblRegistry.Valuename = 'DCCTVer' And tblRegistry.Value <> '1.0' And
tblAssetCustom.Manufacturer Like '%Dell%' And tblADComputers.OU Like
'%OU=Workstations,OU=Computer Accounts,DC=Mariettaeye,DC=com%' And
(tblSystemEnclosure.ChassisTypes <> 8 Or tblSystemEnclosure.ChassisTypes <> 9
Or tblSystemEnclosure.ChassisTypes <> 10)) Or
(tblAssetCustom.State = 1 And tblFileVersions.Found = 0 And
tblFileVersions.FilePathfull = 'C:\program files\dell\dcct.log' And
tblAssetCustom.Manufacturer Like '%Dell%' And tblADComputers.OU Like
'%OU=Workstations,OU=Computer Accounts,DC=Mariettaeye,DC=com%' And
(tblSystemEnclosure.ChassisTypes <> 8 Or tblSystemEnclosure.ChassisTypes <> 9
Or tblSystemEnclosure.ChassisTypes <> 10))
Solved! Go to Solution.
‎11-23-2015 12:19 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssetCustom.State,
tblFileVersions.Found,
SubQuery.Value As RegistryValue
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblFileVersions On tblAssets.AssetID = tblFileVersions.AssetID
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Left Join (Select Top 1000000 tblRegistry.AssetID,
tblRegistry.Value
From tblRegistry
Where tblRegistry.Regkey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Dell' And
tblRegistry.Valuename = 'DCCTVer') SubQuery On SubQuery.AssetID =
tblAssets.AssetID
Where tblAssetCustom.State = 1 And (SubQuery.Value <> '1.0' Or
SubQuery.Value = '' Or SubQuery.Value Is Null) And
tblFileVersions.FilePathfull = 'C:\program files\dell\dcct.log' And
tblAssetCustom.Manufacturer Like '%Dell%' And tblADComputers.OU Like
'%OU=Workstations,OU=Computer Accounts,DC=Mariettaeye,DC=com%' And
tblSystemEnclosure.ChassisTypes Not In (8, 9, 10)
tblSystemEnclosure.ChassisTypes <> 8 Or tblSystemEnclosure.ChassisTypes <> 9
Or tblSystemEnclosure.ChassisTypes <> 10
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
tsysOS.Image As icon
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Where tblAssets.AssetID Not In (Select Top 1000000 tblRegistry.AssetID
From tblRegistry
Where tblRegistry.Regkey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Dell' And
tblRegistry.Valuename = 'DCCTVer') And tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName
‎11-23-2015 12:19 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblAssetCustom.State,
tblFileVersions.Found,
SubQuery.Value As RegistryValue
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblFileVersions On tblAssets.AssetID = tblFileVersions.AssetID
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Left Join (Select Top 1000000 tblRegistry.AssetID,
tblRegistry.Value
From tblRegistry
Where tblRegistry.Regkey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Dell' And
tblRegistry.Valuename = 'DCCTVer') SubQuery On SubQuery.AssetID =
tblAssets.AssetID
Where tblAssetCustom.State = 1 And (SubQuery.Value <> '1.0' Or
SubQuery.Value = '' Or SubQuery.Value Is Null) And
tblFileVersions.FilePathfull = 'C:\program files\dell\dcct.log' And
tblAssetCustom.Manufacturer Like '%Dell%' And tblADComputers.OU Like
'%OU=Workstations,OU=Computer Accounts,DC=Mariettaeye,DC=com%' And
tblSystemEnclosure.ChassisTypes Not In (8, 9, 10)
tblSystemEnclosure.ChassisTypes <> 8 Or tblSystemEnclosure.ChassisTypes <> 9
Or tblSystemEnclosure.ChassisTypes <> 10
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
tsysOS.Image As icon
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Where tblAssets.AssetID Not In (Select Top 1000000 tblRegistry.AssetID
From tblRegistry
Where tblRegistry.Regkey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Dell' And
tblRegistry.Valuename = 'DCCTVer') And tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now