‎08-08-2017 04:38 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tsysOS.OSname As OS,
tblAssets.SP,
tsysPackageLogs.Added As LogDate,
tsysPackages.PackageName As Package,
Case tsysPackageLogs.Success When 0 Then 'No' When 1 Then 'Yes'
End As DeploySuccess,
tsysPackageLogs.Executor,
tsysPackageLogs.Errorcode As [Return],
tsysPackageLogs.LastStepID As LastStep,
Case tsysPackageLogs.RunMode When 1 Then 'System Account'
When 2 Then 'Scanning Credentials' When 3 Then 'Currently Logged On'
End As RunMode,
tsysPackageLogs.Errormessage As Message,
tsysPackageLogs.ServerName As ScanningServer,
tsysPackageLogs.Version As DeployerVersion,
Case tsysPackageLogs.Success When 0 Then 'red' End As foregroundcolor
From tsysPackageLogs
Inner Join tblAssets On tsysPackageLogs.AssetID = tblAssets.AssetID
Inner Join tsysPackages On tsysPackageLogs.PackageID = tsysPackages.PackageID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Inner Join tblState On tblState.State = tblAssetCustom.State
Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Where tblState.Statename = 'Active'
Order By LogDate Desc,
tblAssets.Domain,
tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now