‎10-13-2016 12:05 AM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tsysIPLocations.IPLocation,
tblAssets.AssetName,
tblADusers.Displayname,
tblAssets.IPAddress,
tsysOS.OSname,
tblAssets.Lastseen
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Inner Join tblADusers On tblAssets.Username = tblADusers.Username
Where tblAssets.AssetID Not In (Select tblServices.AssetID
From tblServices Inner Join tblServicesUni On tblServicesUni.ServiceuniqueID =
tblServices.ServiceuniqueID
Where tblServicesUni.Name = 'CcmExec') And tblAssets.Lastseen > GetDate() - 7
And tblAssetCustom.State = 1
Order By tsysIPLocations.IPLocation,
tblAssets.AssetName
‎10-14-2016 12:37 AM
‎10-13-2016 10:39 PM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tsysIPLocations.IPLocation,
tblAssets.AssetName,
tblADusers.Displayname,
tblAssets.IPAddress,
tsysOS.OSname,
tblAssets.Lastseen,
'Success' As Result
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Inner Join tblADusers On tblAssets.Username = tblADusers.Username
Where tblAssets.AssetID Not In (Select tblServices.AssetID
From tblServices Inner Join tblServicesUni On tblServicesUni.ServiceuniqueID =
tblServices.ServiceuniqueID
Where tblServicesUni.Name = 'CcmExec') And tblAssets.Lastseen > GetDate() - 7
And tblAssetCustom.State = 1
Union All
Select Top 1000000 (Case When tsysOS.Image Is Null Then 'notscanned.png'
Else tsysOS.Image End) As icon,
tblErrors.AssetID,
tsysIPLocations.IPLocation,
tblAssets.AssetName,
(Null) As Displayname,
tblAssets.IPAddress,
tsysOS.OSname,
tblAssets.Lastseen,
(tsysasseterrortypes.ErrorMsg + ' - ' + tblErrors.ErrorText) As Result
From tblErrors
Inner Join tblAssets On tblErrors.AssetID = tblAssets.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysasseterrortypes On tblErrors.ErrorType =
tsysasseterrortypes.Errortype
Left Outer Join tblOperatingsystem On tblAssets.AssetID =
tblOperatingsystem.AssetID
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Where tblAssetCustom.State = 1 And tblOperatingsystem.AssetID Is Null And
tblErrors.ErrorType = 1
Order By IPLocation,
AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now