‎09-18-2019 05:42 PM
‎09-19-2019 01:54 PM
‎09-18-2019 06:41 PM
Case
When tblEncryptableVolume.ProtectionStatus = 0 Then 'OFF'
When tblEncryptableVolume.ProtectionStatus = 1 Then 'ON'
Else 'UNKNOWN'
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssetCustom.Comments,
tblAssets.Domain,
tblAssets.Username,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblTPM.SpecVersion,
Case
When tblTPM.IsActivated_InitialValue = 1 Then 'Yes'
When tblTPM.IsActivated_InitialValue Is Null Then Null
Else 'No'
End As Activated,
Case
When tblTPM.IsEnabled_InitialValue = 1 Then 'Yes'
When tblTPM.IsEnabled_InitialValue Is Null Then Null
Else 'No'
End As Enabled,
Case
When tblTPM.IsOwned_InitialValue = 1 Then 'Yes'
When tblTPM.IsOwned_InitialValue Is Null Then Null
Else 'No'
End As Owned,
tblOperatingsystem.Caption As OS,
tblAssets.SP,
tblEncryptableVolume.DriveLetter,
Case
When tblEncryptableVolume.ProtectionStatus = 0 Then 'OFF'
When tblEncryptableVolume.ProtectionStatus = 1 Then 'ON'
Else 'UNKNOWN'
End As ProtectionStatus,
tblAssets.Lastseen,
Case
When tblPortableBattery.AssetID Is Null Then 'Desktop'
Else 'Laptop'
End As [Desktop/Laptop],
Case
When tblTPM.AssetId Is Null Then 'noTPM'
Else 'HasTPM'
End As HasTPMorNot,
tblTPM.IsEnabled_InitialValue,
tblTPM.IsOwned_InitialValue,
tblTPM.ManufacturerVersionInfo,
tblTPM.ManufacturerVersion,
tblTPM.ManufacturerId,
tblTPM.PhysicalPresenceVersionInfo,
tblEncryptableVolume.LastChanged,
tblBIOS.Caption,
tblBIOS.Manufacturer As Manufacturer1,
tblBIOS.SerialNumber,
tblBIOS.SMBIOSMajorVersion,
tblBIOS.SMBIOSBIOSVersion,
tblBIOS.SMBIOSMinorVersion,
tblBIOS.Version,
tblTPM.LastChanged As TPMTableLastChanged
From tblAssets
Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblOperatingsystem On
tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tsysIPLocations On tsysIPLocations.LocationID = tblAssets.LocationID
Inner Join tblState On tblState.State = tblAssetCustom.State
Inner Join tblBIOS On tblAssets.AssetID = tblBIOS.AssetID
Left Join tblPortableBattery On tblAssets.AssetID = tblPortableBattery.AssetID
Inner Join tblTPM On tblAssets.AssetID = tblTPM.AssetId
Left Join tblEncryptableVolume On
tblAssets.AssetID = tblEncryptableVolume.AssetId
Where (tblAssetCustom.Model Is Null Or
tblAssetCustom.Model = '' Or tblAssetCustom.Model Not Like '%Virtual%') And
tblOperatingsystem.Caption Not Like '%professional%' And
tblEncryptableVolume.DriveLetter Like '%C%' And tblAssets.Lastseen Is Not Null
And tblAssets.Lastseen <> '' And tblAssets.Lastseen > GetDate() - 3 And
tblState.Statename = 'Active' And tsysAssetTypes.AssetTypename In ('Windows')
Order By tblAssets.Domain,
tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now