cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kevinoie
Engaged Sweeper III
Hi, Im trying to run a report to find when users last logged on and to also include users who have an account in AD but who have NEVER logged on. When I run the below report I can see users and their last logon time, but it doesnt show me the user accounts who never logged on.

Select Top 1000000 tblADusers.Firstname,
tblADusers.Lastname,
tblADusers.Username,
tblADusers.Office,
tblADusers.Department,
tblADusers.Description,
tblADusers.email,
maxlogon.Latest,
tblADusers.Mobile,
tblADusers.whenCreated,
tblADusers.Company
From (Select upgrade_tblCPlogoninfo.Domain,
upgrade_tblCPlogoninfo.Username,
Max(upgrade_tblCPlogoninfo.logontime) As Latest
From upgrade_tblCPlogoninfo
Group By upgrade_tblCPlogoninfo.Domain,
upgrade_tblCPlogoninfo.Username) maxlogon
Inner Join tblADusers On maxlogon.Domain = tblADusers.Userdomain And
maxlogon.Username = tblADusers.Username

What do i need to add to this to include the users who have never logged on?

Many Thanks,

Kevin.
1 REPLY 1
Hemoco
Lansweeper Alumni
Right-click on the link between tblADusers and maxlogon and tick "select all rows from tblADusers".

If you're interested in building custom reports, we would recommend reviewing some SQL tutorials. The Lansweeper report builder uses standard SQL queries and what you are asking is a basic SQL thing. If you know how to build SQL queries, then you'll know how to build Lansweeper reports as well. There are several good SQL tutorials available online, e.g.: http://www.w3schools.com/sql/default.asp