‎12-06-2016 03:52 PM
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblUsersInGroup.Username,
tblUsersInGroup.Groupname
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblUsersInGroup On tblAssets.AssetID = tblUsersInGroup.AssetID
Inner Join tblUsers On tblAssets.AssetID = tblUsers.AssetID
Inner Join tblAssets tblAssets1 On tblAssets1.AssetID = tblAssetCustom.AssetID
And tblAssets1.AssetID = tblUsersInGroup.AssetID And tblAssets1.AssetID =
tblUsers.AssetID And tsysAssetTypes.AssetType = tblAssets1.Assettype
Where tblAssets.Lastseen > GetDate() - 120 And tblUsersInGroup.Username <>
'Domain Admins' And tblUsersInGroup.Groupname = 'Administrators' And
tblAssetCustom.State = 1
Order By tblAssets.AssetName
Solved! Go to Solution.
‎12-23-2016 04:58 PM
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblUsersInGroup.Username,
tblUsersInGroup.Groupname
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblUsersInGroup On tblAssets.AssetID = tblUsersInGroup.AssetID
Inner Join tblUsers On tblAssets.AssetID = tblUsers.AssetID
Inner Join tblAssets tblAssets1 On tblAssets1.AssetID = tblAssetCustom.AssetID
And tblAssets1.AssetID = tblUsersInGroup.AssetID And tblAssets1.AssetID =
tblUsers.AssetID And tsysAssetTypes.AssetType = tblAssets1.Assettype
Where tblAssets.Lastseen > GetDate() - 120 And tblUsersInGroup.Username <>
'Domain Admins' And tblUsersInGroup.Groupname = 'Administrators' And
tblAssetCustom.State = 1
Order By tblAssets.AssetName
‎12-23-2016 06:04 PM
‎12-23-2016 04:58 PM
Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblUsersInGroup.Username,
tblUsersInGroup.Groupname
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblUsersInGroup On tblAssets.AssetID = tblUsersInGroup.AssetID
Inner Join tblUsers On tblAssets.AssetID = tblUsers.AssetID
Inner Join tblAssets tblAssets1 On tblAssets1.AssetID = tblAssetCustom.AssetID
And tblAssets1.AssetID = tblUsersInGroup.AssetID And tblAssets1.AssetID =
tblUsers.AssetID And tsysAssetTypes.AssetType = tblAssets1.Assettype
Where tblAssets.Lastseen > GetDate() - 120 And tblUsersInGroup.Username <>
'Domain Admins' And tblUsersInGroup.Groupname = 'Administrators' And
tblAssetCustom.State = 1
Order By tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now