cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
KHabershon
Engaged Sweeper II
Anyone have a report or can create one that shows a list of a "single" user that has logged into multiple computers.

What I am trying to do is find out a list of users that potentially have multiple systems, like a desktop and then also has a laptop.
1 ACCEPTED SOLUTION
Hemoco
Lansweeper Alumni
Can you try this one:

Select query.Domain, query.Username, Count(query.Computername)
From (Select Distinct tblCPlogoninfo.Computername, tblCPlogoninfo.Domain,
tblCPlogoninfo.Username
From tblCPlogoninfo
Group By All tblCPlogoninfo.Computername, tblCPlogoninfo.Domain,
tblCPlogoninfo.Username) query
Group By query.Domain, query.Username
Order By Count(query.Computername) Desc

View solution in original post

14 REPLIES 14
Kboyer
Engaged Sweeper III
Sweet! Thank-you
Kboyer
Engaged Sweeper III
This is exactly what I was looking for thanks.
Also looking for help with "Top user Logons" for each PC. There was a query in the forum for Version 4 but I am having difficulty converting it to use Version 5 tables.
Hemoco
Lansweeper Alumni
Kboyer wrote:
This is exactly what I was looking for thanks.
Also looking for help with "Top user Logons" for each PC. There was a query in the forum for Version 4 but I am having difficulty converting it to use Version 5 tables.

The report below lists your computers, the users that have logged into them and counts of the number of logons per user and per computer.
Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblCPlogoninfo.Username,
tblCPlogoninfo.Domain As Userdomain,
Count(tblCPlogoninfo.ID) As LogonCount
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblCPlogoninfo On tblAssets.AssetID = tblCPlogoninfo.AssetID
Where tblAssetCustom.State = 1
Group By tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblCPlogoninfo.Username,
tblCPlogoninfo.Domain,
tblAssetCustom.State
Order By tblAssets.Domain,
tblAssets.AssetName,
LogonCount Desc
Hemoco
Lansweeper Alumni
You can try this query:
Select Top 1000000 tblAssets.Username,
tblAssets.Userdomain,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
SubQuery1.Count As LoginCount
From tblAssets
Inner Join (Select Top 1000000 tblCPlogoninfo.Username,
tblCPlogoninfo.Domain As Userdomain,
tblCPlogoninfo.AssetID,
Count(tblCPlogoninfo.ID) As Count
From tblCPlogoninfo
Group By tblCPlogoninfo.Username,
tblCPlogoninfo.Domain,
tblCPlogoninfo.AssetID
Having Count(tblCPlogoninfo.ID) >= 5) SubQuery1 On SubQuery1.Username =
tblAssets.Username And SubQuery1.Userdomain = tblAssets.Userdomain
And SubQuery1.AssetID = tblAssets.AssetID
Inner Join (Select Top 1000000 tblAssets.Username,
tblAssets.Userdomain,
Count(tblAssets.AssetID) As Count
From tblAssets
Group By tblAssets.Username,
tblAssets.Userdomain
Having Count(tblAssets.AssetID) > 1
Order By tblAssets.Userdomain,
tblAssets.Username) SubQuery2 On SubQuery2.Username = tblAssets.Username And
SubQuery2.Userdomain = tblAssets.Userdomain
Order By tblAssets.Userdomain,
tblAssets.Username,
tblAssets.Domain,
tblAssets.AssetName
Kreg
Engaged Sweeper II
Re!

To be more accurate, do you know if it's possible to query user connected on several PCs, but with at least five successive logon?
Because if I am connecting to the PC from my neighbor, I get the last logon, and this distorts the query...
You see what i mean ?

Thanks !
Hemoco
Lansweeper Alumni
Try:
Select Top 1000000 tblAssets.Username,
tblAssets.Userdomain,
Count(tblAssets.AssetID) As LastLoggedIntoCount
From tblAssets
Group By tblAssets.Username,
tblAssets.Userdomain
Having tblAssets.Username <> '' And tblAssets.Userdomain <> ''
Kreg
Engaged Sweeper II
Lansweeper wrote:
Try:
Select Top 1000000 tblAssets.Username,
tblAssets.Userdomain,
Count(tblAssets.AssetID) As LastLoggedIntoCount
From tblAssets
Group By tblAssets.Username,
tblAssets.Userdomain
Having tblAssets.Username <> '' And tblAssets.Userdomain <> ''


Oh yes, perfect !
Thank you 🙂
Have a nice day
Kreg
Engaged Sweeper II
Thanks for your reply
But this query report all computers where user has connected "one time", but not the last user connected.
Example for my username, I have 10 computers listed, but only 4 where I'm the laster user connected.
The goal is really to track user with more than one PCs...

an idea ? 🙂
Thanks !
Hemoco
Lansweeper Alumni
A sample 5.0 report that lists your users and the computers they've logged into can be seen below.
Select Distinct Top 1000000 tblCPlogoninfo.Username,
tblCPlogoninfo.Domain As Userdomain,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress
From tblCPlogoninfo
Inner Join tblAssets On tblAssets.AssetID = tblCPlogoninfo.AssetID
Order By Userdomain,
tblCPlogoninfo.Username,
tblAssets.Domain,
tblAssets.AssetName