Hi,
I'm trying to find a list of users who has been assigned multiple windows assets.
The below query which i have written is giving me zero results and i know something is not right in the report and can't able to figure that out
Any help would be helpful
Select Top 1000000 tblAssets.AssetID,
tblAssets.UserName As [Scanned GPID],
tblAssets.AssetName,
tblAssetCustom.Serialnumber,
tblADusers.Username As [AD.GPID],
tblADusers.Name As [AD.Username],
tblAssets.IPAddress,
tsysIPLocations.IPLocation As [IP location],
tblAssetCustom.Custom6 As [Assigned Location],
tblAssetCustom.Custom7 As [Sub Location],
tblAssetCustom.Custom4 As [FPR Unit]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tblAssets.Assettype = tsysAssetTypes.AssetType
Left Join tsysIPLocations
On tblAssets.IPNumeric Between tsysIPLocations.StartIP And
tsysIPLocations.EndIP
Left Join tblADusers On tblADusers.Username = tblAssets.Username
Where tblAssetCustom.State = 1 And tsysAssetTypes.AssetTypename = 'Windows'
Group By tblAssets.AssetID,
tblAssets.UserName,
tblAssets.AssetName,
tblAssetCustom.Serialnumber,
tblADusers.Username,
tblADusers.Name,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssetCustom.Custom6,
tblAssetCustom.Custom7,
tblAssetCustom.Custom4
Having Count(tblAssets.UserName) > 1
Order By tblAssets.UserName