‎06-15-2017 04:07 PM
Solved! Go to Solution.
‎06-19-2017 04:12 PM
Select Distinct Top 1000000 tblAssets.AssetUnique,
tblUsersInGroup.AssetID,
tblAssets.Domain,
tblAssets.Description,
Admins.Users
From tblUsersInGroup
Inner Join tblAssets On tblUsersInGroup.AssetID = tblAssets.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join (Select T1.AssetID,
Stuff((Select ',' + T2.Username From tblUsersInGroup As T2
Where T2.AssetID = T1.AssetID And T2.Admingroup = 1 For Xml Path('')), 1, 1,
'') As Users
From tblUsersInGroup As T1
Group By T1.AssetID) As Admins On Admins.AssetID = tblUsersInGroup.AssetID
Where tblUsersInGroup.Admingroup = 1 And tblAssetCustom.State = 1
Order By tblAssets.AssetUnique
‎06-19-2017 04:36 PM
‎06-19-2017 04:12 PM
Select Distinct Top 1000000 tblAssets.AssetUnique,
tblUsersInGroup.AssetID,
tblAssets.Domain,
tblAssets.Description,
Admins.Users
From tblUsersInGroup
Inner Join tblAssets On tblUsersInGroup.AssetID = tblAssets.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join (Select T1.AssetID,
Stuff((Select ',' + T2.Username From tblUsersInGroup As T2
Where T2.AssetID = T1.AssetID And T2.Admingroup = 1 For Xml Path('')), 1, 1,
'') As Users
From tblUsersInGroup As T1
Group By T1.AssetID) As Admins On Admins.AssetID = tblUsersInGroup.AssetID
Where tblUsersInGroup.Admingroup = 1 And tblAssetCustom.State = 1
Order By tblAssets.AssetUnique
‎12-09-2022 07:15 PM
Is it possible to be able to filter out certain usernames or group names?
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now