Notification

Icon
Error

Report to find all computers with no logon data

Posted: Thursday, June 25, 2020 5:49:06 PM(UTC)
mravel

mravel

Member Original PosterPosts: 1
1
Like
I'm attempting to run a report to find all devices that either have Config > User Info > Last logon as blank/null or that have a logon time older than X days but i keep getting blank results. Would someone be able to assist? Thank you.

I've used this as a baseline (but this does not include assets with no logon data)

Code:

Select Top 1000000 SubQuery.Username,
  SubQuery.Domain As Userdomain,
  SubQuery.LastLogon,
  tblAssets.AssetName,
  tblAssets.Domain
From tblCPlogoninfo
  Inner Join (Select Top 1000000 tblCPlogoninfo.Username,
        tblCPlogoninfo.Domain,
        Max(tblCPlogoninfo.logontime) As LastLogon
      From tblCPlogoninfo
      Group By tblCPlogoninfo.Username,
        tblCPlogoninfo.Domain) SubQuery On tblCPlogoninfo.Username =
    SubQuery.Username And tblCPlogoninfo.Domain = SubQuery.Domain And
    tblCPlogoninfo.logontime = SubQuery.LastLogon
  Inner Join tblAssets On tblAssets.AssetID = tblCPlogoninfo.AssetID
Andy.S
#1Andy.S Member Posts: 27  
posted: 7/2/2020 9:55:53 AM(UTC)
Hi ,

I think this should do what you need, I have set the Days to 90 :

Code:
Select Top 1000000 SubQuery.Username,
  SubQuery.Domain As Userdomain,
  SubQuery.LastLogon,
  tblAssets.AssetName,
  tblAssets.Domain
From tblCPlogoninfo
  Inner Join (Select Top 1000000 tblCPlogoninfo.Username,
        tblCPlogoninfo.Domain,
        Max(tblCPlogoninfo.logontime) As LastLogon
      From tblCPlogoninfo
      Group By tblCPlogoninfo.Username,
        tblCPlogoninfo.Domain) SubQuery On tblCPlogoninfo.Username =
    SubQuery.Username And tblCPlogoninfo.Domain = SubQuery.Domain And
    tblCPlogoninfo.logontime = SubQuery.LastLogon
  Inner Join tblAssets On tblAssets.AssetID = tblCPlogoninfo.AssetID
Where (SubQuery.LastLogon <= DateAdd(day, -90, GetDate()) Or
    SubQuery.LastLogon Is Null)

Active Discussions

Lansweeper Software List by Computer/Server Name
by  Andy.S  
Go to last post Go to first unread
Last post: Yesterday at 8:06:43 AM(UTC)
Lansweeper Asset: Duplicate Serial Number (Built-in)
by  brodiemac-too   Go to last post Go to first unread
Last post: 8/5/2020 1:28:56 PM(UTC)
Lansweeper A Simple Report (or so I thought)
by  Andy.S  
Go to last post Go to first unread
Last post: 8/5/2020 11:30:45 AM(UTC)
Lansweeper Paid Report Writer Service
by  endyk   Go to last post Go to first unread
Last post: 8/4/2020 11:56:20 AM(UTC)
Lansweeper Multiple Computers per User
by  brodiemac-too  
Go to last post Go to first unread
Last post: 7/30/2020 12:43:38 PM(UTC)
Lansweeper Workstations with No AV
by  brodiemac-too   Go to last post Go to first unread
Last post: 7/29/2020 7:44:53 PM(UTC)
Lansweeper AV Audit Report
by  RC62N  
Go to last post Go to first unread
Last post: 7/29/2020 5:17:42 PM(UTC)