
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 02:22 AM
Hi, I was looking for a post about LastLogon User's OU relation with the ADComputers OU, but could find anything. We are looking to gather a report for the (LastUser + LastUser OU) Grouping it + (AssetComputer + ADComputer OU) Grouping it. So the report basically should display the ADLastUser and its OU + ADComputer the user last time connected and its ADComputer OU.
Thank you...
Thank you...
Labels:
- Labels:
-
General Discussion
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 02:31 AM
Built this query, but any other suggestion is welcome'd.
Select Top 1000000 tblAssets.Username,
tblAssets.Userdomain,
Coalesce(tblADusers.Displayname, tblAssets.Username) As Displayname,
tblAssets.Lastseen,
tblAssets.AssetID,
tblAssets.AssetName,
tblADusers.OU,
tblADComputers.OU As OU1
From tblAssets
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Outer Join tblADusers On tblAssets.Userdomain = tblADusers.Userdomain And
tblAssets.Username = tblADusers.Username
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Order By tblAssets.Lastseen Desc
