→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
David_P
Engaged Sweeper
Hi,

we neeed to make report with this parameters:

column 1 - User name
column 2 - all devices with any relationships with selected user
column 3 - devices serial numbers

Can you help me please?
1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
A sample report can be seen below.
Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.Name,
tblADusers.Displayname,
tsysAssetRelationTypes.ReverseName As RelationType,
tblAssetUserRelations.StartDate As RelationStartDate,
tblAssetUserRelations.Lastchanged As RelationLastchanged,
tblAssetUserRelations.Comments As RelationComments,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tsysAssetTypes.AssetTypename As AssetType,
tblAssetCustom.Serialnumber,
tblAssets.Firstseen,
tblAssets.Lastseen
From tblADusers
Inner Join tblAssetUserRelations On tblADusers.Username =
tblAssetUserRelations.Username And tblADusers.Userdomain =
tblAssetUserRelations.Userdomain
Inner Join tblAssets On tblAssets.AssetID = tblAssetUserRelations.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tsysAssetRelationTypes On tsysAssetRelationTypes.RelationTypeID =
tblAssetUserRelations.Type
Order By tblADusers.Userdomain,
tblADusers.Username,
RelationType

View solution in original post

1 REPLY 1
Hemoco
Lansweeper Alumni
A sample report can be seen below.
Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.Name,
tblADusers.Displayname,
tsysAssetRelationTypes.ReverseName As RelationType,
tblAssetUserRelations.StartDate As RelationStartDate,
tblAssetUserRelations.Lastchanged As RelationLastchanged,
tblAssetUserRelations.Comments As RelationComments,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tsysAssetTypes.AssetTypename As AssetType,
tblAssetCustom.Serialnumber,
tblAssets.Firstseen,
tblAssets.Lastseen
From tblADusers
Inner Join tblAssetUserRelations On tblADusers.Username =
tblAssetUserRelations.Username And tblADusers.Userdomain =
tblAssetUserRelations.Userdomain
Inner Join tblAssets On tblAssets.AssetID = tblAssetUserRelations.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tsysAssetRelationTypes On tsysAssetRelationTypes.RelationTypeID =
tblAssetUserRelations.Type
Order By tblADusers.Userdomain,
tblADusers.Username,
RelationType