Notification

Icon
Error

Last used system of users in a specific OU

Posted: Wednesday, October 28, 2020 12:32:21 PM(UTC)
chriscornelis

chriscornelis

Member Original PosterPosts: 2
1
Like
This issue has been solved! Click here to view the solution
Hello,

I am having issues creating a report.
What I would like is a report of the computers/systems used by users in a specific OU.
So far example a list of all the users in a specific AD OU with the last system they logged on to.

How can I create a report like this ?

Thank you

Chris
Brandon
#1Brandon Member Posts: 57  
posted: 10/28/2020 5:05:18 PM(UTC)
See if this gives you what you want. On the where line you will need to replace the name of your OU. Be sure to leave the percent signs. I also included an optional time where you can limit the logons listed in the query. This will shorten the query time. If you want all logons showed, you can just remove " tblCPlogoninfo.logontime > GetDate() - 5 And" This will also only show active assets.

Quote:
Select Top 1000000 tblAssets.AssetID,
tblCPlogoninfo.Username,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblCPlogoninfo.logontime,
tblADusers.OU
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblCPlogoninfo On tblAssets.AssetID = tblCPlogoninfo.AssetID
Inner Join tblADusers On tblCPlogoninfo.Username = tblADusers.Username
Where tblCPlogoninfo.logontime > GetDate() - 5 And tblADusers.OU Like '%bar%'
And tblAssetCustom.State = 1

chriscornelis
#2chriscornelis Member Original PosterPosts: 2  
posted: 10/29/2020 11:11:35 AM(UTC)
Thank you !

Active Discussions

Lansweeper We're Hiring!
by  Esben.D   Go to last post Go to first unread
Last post: 10/24/2019 8:27:38 AM(UTC)
Lansweeper 2019 Fall Release
by  Esben.D  
Go to last post Go to first unread
Last post: 9/5/2019 3:48:58 PM(UTC)
Lansweeper Introducing Our Brand New Report Library
by  Esben.D   Go to last post Go to first unread
Last post: 7/2/2019 2:09:53 PM(UTC)
Lansweeper Lansweeper subreddit
by  Esben.D  
Go to last post Go to first unread
Last post: 4/4/2019 8:57:11 AM(UTC)
Lansweeper 2019 Spring Release
by  Esben.D   Go to last post Go to first unread
Last post: 3/5/2019 4:11:32 PM(UTC)
Lansweeper Mozilla Firefox Remote Execution Vulnerability
by  Esben.D  
Go to last post Go to first unread
Last post: 10/5/2018 12:33:36 PM(UTC)
Lansweeper Lansweeper 7 Released
by  Esben.D   Go to last post Go to first unread
Last post: 9/19/2018 1:33:10 PM(UTC)
Lansweeper MEGA Chrome Extension Vulnerability
by  Esben.D  
Go to last post Go to first unread
Last post: 9/6/2018 1:25:43 PM(UTC)