Notification

Icon
Error

AD Users to Managers and their devices. - List Users to Managers and their devices.

Posted: Friday, January 17, 2020 1:45:52 PM(UTC)
C&C

C&C

Member Original PosterPosts: 7
0
Like
Help please,

I need a report that when I filter by the manager shows all staff that are managed by the manager.
along with this I want it to show the devices that are associated to the staff member.
I have managed to produce Staff to managers and then tried adding the devices but it does not work correctly.

Any help will be appreciated.

Code:

Select Top 1000000 tblADusers.Username As [User LID],
tblADusers.Displayname,
tblADusers.email As Email,
tsysIPLocations.IPLocation As [Building Location],
tblAssets.AssetName,
tblAssets.AssetID,
tblAssetCustom.Model,
tblAssets.Lastseen,
tblADObjects.sAMAccountName As [Manager LID],
Manager.Displayname As [Manager Name],
Manager.email As [Manager email]
From tblADusers
Left Join tblADObjects On
tblADObjects.ADObjectID = tblADusers.ManagerADObjectId
Inner Join tblADusers Manager On tblADObjects.ADObjectID = Manager.ADObjectID
Left Join tblAssets On tblAssets.Username = tblADusers.Username And
tblAssets.Userdomain = tblADusers.Userdomain
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID

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)