You can try the report below to list users:
- For whom no logon events have been detected.
- For whom the most recently detected logon occurred more than 90 days ago.
Select Top 1000000 tblADusers.Username,
tblADusers.Userdomain,
SubQuery1.Lastlogon
From tblADusers
Left Join (Select Top 1000000 tblCPlogoninfo.Username,
tblCPlogoninfo.Domain As Userdomain,
Max(tblCPlogoninfo.logontime) As Lastlogon
From tblCPlogoninfo
Group By tblCPlogoninfo.Username,
tblCPlogoninfo.Domain) SubQuery1 On SubQuery1.Username = tblADusers.Username
And SubQuery1.Userdomain = tblADusers.Userdomain
Where (SubQuery1.Lastlogon Is Null) Or
(SubQuery1.Lastlogon < GetDate() - 90)
Order By tblADusers.Userdomain,
tblADusers.Username