Notification

Icon
Error

Distinct user logins per PC location map - I want to get the floorname on the location map instead of the pc name.

Posted: Tuesday, May 17, 2022 12:53:26 PM(UTC)
Steven Coomans

Steven Coomans

Member Original PosterPosts: 1
0
Like
I have found the following report which gives me the PC names, but I need it with the location map names. So we have created a location map here with all the pc's on it and I would like to see this name from the location map in my report.

Code:
Select tblAssets.AssetID,
  tblAssets.AssetName,
  T1.Domain,
  T1.Username,
  T1.LastLogonTime
From tblAssets
  Inner Join tblAssetCustom On tblAssetCustom.AssetID = tblAssets.AssetID
  Inner Join (Select tblCPlogoninfo.AssetID,
      tblCPlogoninfo.Username,
      tblCPlogoninfo.Domain,
      Max(tblCPlogoninfo.logontime) As LastLogonTime
    From tblCPlogoninfo
    Group By tblCPlogoninfo.AssetID,
      tblCPlogoninfo.Username,
      tblCPlogoninfo.Domain) T1 On T1.AssetID = tblAssets.AssetID
Where tblAssetCustom.State = 1
Order By tblAssets.AssetName,
  T1.LastLogonTime Desc



The following code gives the map location instead of the PC name, but I also need the distinct users so it should be a mix but I can't get it right.


Code:
Select Top 1000000 tsysAssetTypes.AssetTypeIcon10 As icon,
  tblAssets.AssetName As Location,
  tblAssets1.AssetID,
  tblAssets1.AssetName,
  tblAssets1.Domain,
  tsysAssetTypes1.AssetTypename As AssetType,
  tblAssets1.Username,
  tblAssets1.Userdomain,
  tblAssets1.IPAddress,
  tsysIPLocations.IPLocation,
  tblAssetCustom.Manufacturer,
  tblAssetCustom.Model,
  Coalesce(tsysOS.OSname, tblLinuxSystem.OSRelease, tblMacOSInfo.SystemVersion)
  As OS,
  tblAssets.SP,
  tblAssets1.Lastseen,
  tblAssets1.Lasttried
From tblAssets
  Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
  Inner Join tblAssetRelations
    On tblAssets.AssetID = tblAssetRelations.ParentAssetID
  Inner Join tsysAssetRelationTypes On tsysAssetRelationTypes.RelationTypeID =
    tblAssetRelations.Type
  Inner Join tblAssets tblAssets1 On tblAssets1.AssetID =
    tblAssetRelations.ChildAssetID
  Inner Join tsysAssetTypes tsysAssetTypes1 On tsysAssetTypes1.AssetType =
    tblAssets1.Assettype
  Inner Join tblAssetCustom On tblAssets1.AssetID = tblAssetCustom.AssetID
  Inner Join tblState On tblState.State = tblAssetCustom.State
  Inner Join tsysIPLocations On tsysIPLocations.LocationID =
    tblAssets1.LocationID
  Left Join tblLinuxSystem On tblAssets1.AssetID = tblLinuxSystem.AssetID
  Left Join tblMacOSInfo On tblAssets1.AssetID = tblMacOSInfo.AssetID
  Left Join tsysOS On tsysOS.OScode = tblAssets1.OScode
Where tsysAssetRelationTypes.ReverseName = 'has location of' And
  tblState.Statename = 'Active'
Order By Location,
  tblAssets1.IPNumeric,
  tblAssets1.Domain,
  tblAssets1.AssetName



I hope that someone here can help me because I am really stuck.

Thanks,

Steven

Active Discussions

Lansweeper Version 10.2.0.0
by  ThomasK   Go to last post Go to first unread
Last post: Today at 6:11:28 AM(UTC)
Lansweeper Certificates
by  Orion Poplawski  
Go to last post Go to first unread
Last post: 7/1/2022 10:11:12 PM(UTC)
Lansweeper Dell warranty lookup not working
by  LANGuy  
Go to last post Go to first unread
Last post: 7/1/2022 1:30:06 PM(UTC)
Lansweeper RedHat 8.5 & SELinux
by  QuelleAcht   Go to last post Go to first unread
Last post: 7/1/2022 1:16:19 PM(UTC)
Lansweeper Suddenly seeing Access Denied scanning errors?
by  Erik.T  
Go to last post Go to first unread
Last post: 7/1/2022 9:38:17 AM(UTC)
Lansweeper Single Line report with H/D
by  Ioannis   Go to last post Go to first unread
Last post: 7/1/2022 7:53:23 AM(UTC)
Lansweeper Lansweeper Dark Theme
by  mrobbins  
Go to last post Go to first unread
Last post: 6/30/2022 5:38:01 PM(UTC)