→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎12-03-2010 09:01 PM
Solved! Go to Solution.
‎12-05-2010 01:38 PM
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
‎08-27-2013 08:13 PM
‎08-27-2013 03:26 AM
‎08-27-2013 07:07 PM
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.
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
‎08-26-2013 07:26 PM
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
‎08-23-2013 06:41 PM
‎08-23-2013 03:33 PM
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 <> ''
‎08-23-2013 04:40 PM
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 <> ''
‎08-23-2013 03:25 PM
‎08-22-2013 10:03 PM
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
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now