So far I have this basic report that shows user information, all I'm missing is the last computer used/logged on for the user
Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
SubQuery1.Lastlogon,
SubQuery1.DaysSinceLogon,
tblADusers.Lastname,
tblADusers.Firstname,
tblADusers.Description,
tblADusers.City,
tblADusers.Zip,
tblADusers.Country,
tblADusers.UPN,
tblADusers.Title,
tblADusers.Department,
tblADusers.OU,
tblADusers.email,
tblADusers.Lastchanged,
tblADusers.IpPhone,
tblADusers.HomeDirectory,
tblADusers.ProfilePath,
tblADusers.LogonScript,
tblADusers.whenCreated,
tblADusers.whenChanged,
tblADusers.EmployeeType,
tblADusers.Info,
tblADusers.Division,
tblADusers.ADUserID,
tblADusers.EmployeeID,
tblADusers.EmployeeNumber
From tblADusers
Left Join (Select Top 1000000 tblCPlogoninfo.Username,
tblCPlogoninfo.Domain As Userdomain,
Max(tblCPlogoninfo.logontime) As Lastlogon,
DateDiff(day, Max(tblCPlogoninfo.logontime), GetDate()) As DaysSinceLogon
From tblCPlogoninfo
Group By tblCPlogoninfo.Username,
tblCPlogoninfo.Domain) SubQuery1 On SubQuery1.Username = tblADusers.Username
And SubQuery1.Userdomain = tblADusers.Userdomain
Where SubQuery1.Lastlogon Is Not Null And
tblADusers.OU Not Like '%OU=Disabled Accounts%'
Order By tblADusers.Userdomain,
tblADusers.Username
Thanks