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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Slicer
Engaged Sweeper III
Hello

Is there any way to create a report that compares the user relation (used by) with thze last-logon on a computer?

Thank you
1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
A sample report can be seen below. It lists your computers, their last logged on user and their "used by" user relations. We also added a column that indicates whether or not the last logged on user is different from the user relation. To use the report below, do the following:
•Open the report builder under Reports/Create New Report.
•Paste the SQL code we provided at the bottom of the page.
•Left-click somewhere in the upper section of the page so the code applies.
•Give the report a Title and hit the Save & Run button to save it. Export options are listed on the left.
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Username As LastLogonUser,
tblAssets.Userdomain As LastLogonDomain,
tblAssetUserRelations.Username As RelationUser,
tblAssetUserRelations.Userdomain As RelationDomain,
tblAssets.Firstseen,
tblAssets.Lastseen,
Case When tblAssets.Username <> tblAssetUserRelations.Username Or
tblAssets.Userdomain <> tblAssetUserRelations.Userdomain Then 'different'
Else 'same' End As UserComparison
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblAssetUserRelations On tblAssets.AssetID =
tblAssetUserRelations.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tsysAssetRelationTypes On tsysAssetRelationTypes.RelationTypeID =
tblAssetUserRelations.Type
Where tsysAssetRelationTypes.Name = 'used by' And tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName

View solution in original post

2 REPLIES 2
Slicer
Engaged Sweeper III
Thank you for the quick reply.
This is exactly what i was looking for.

Perhaps this can be a suggestion for future versions.
This way there can be more control when comparing assigned users with the hardware.
Hemoco
Lansweeper Alumni
A sample report can be seen below. It lists your computers, their last logged on user and their "used by" user relations. We also added a column that indicates whether or not the last logged on user is different from the user relation. To use the report below, do the following:
•Open the report builder under Reports/Create New Report.
•Paste the SQL code we provided at the bottom of the page.
•Left-click somewhere in the upper section of the page so the code applies.
•Give the report a Title and hit the Save & Run button to save it. Export options are listed on the left.
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Username As LastLogonUser,
tblAssets.Userdomain As LastLogonDomain,
tblAssetUserRelations.Username As RelationUser,
tblAssetUserRelations.Userdomain As RelationDomain,
tblAssets.Firstseen,
tblAssets.Lastseen,
Case When tblAssets.Username <> tblAssetUserRelations.Username Or
tblAssets.Userdomain <> tblAssetUserRelations.Userdomain Then 'different'
Else 'same' End As UserComparison
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblAssetUserRelations On tblAssets.AssetID =
tblAssetUserRelations.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tsysAssetRelationTypes On tsysAssetRelationTypes.RelationTypeID =
tblAssetUserRelations.Type
Where tsysAssetRelationTypes.Name = 'used by' And tblAssetCustom.State = 1
Order By tblAssets.Domain,
tblAssets.AssetName

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now