Notification

Icon
Error

AD DistinguishedName of Computer object - AD DistinguishedName of Computer object added to asset report

Posted: Thursday, October 14, 2021 6:52:50 PM(UTC)
elKastr0nom

elKastr0nom

Member Original PosterPosts: 7
0
Like
How would I go about adding one of these fields to my current report?

Here is my current report:

Select Top 1000000 tblassets.AssetID,
tblassets.AssetName,
tsysassettypes.AssetTypename,
tsysassettypes.AssetTypeIcon10 As icon,
tblassets.Domain,
tblassets.Username,
tblassetcustom.PurchaseDate,
tblassetcustom.Warrantydate,
tblassets.Mac,
tblassetcustom.Manufacturer,
tblassetcustom.Model,
tblassetcustom.Serialnumber,
tsysIPLocations.IPLocation
From tblassets
Inner Join tblassetcustom On tblassets.AssetID = tblassetcustom.AssetID
Inner Join tsysassettypes On tsysassettypes.AssetType = tblassets.Assettype
Inner Join lansweeperdb.dbo.tsysIPLocations On tsysIPLocations.LocationID =
tblassets.LocationID
Where tsysassettypes.AssetTypename = 'Windows'
Andy.S
#1Andy.S Member Posts: 123  
posted: 10/27/2021 3:56:53 PM(UTC)
You could do it this way :

Code:
Select Top 1000000 tblassets.AssetID,
  tblassets.AssetName,
  tsysassettypes.AssetTypename,
  tsysassettypes.AssetTypeIcon10 As icon,
  tblassets.Domain,
  tblassets.Username,
  tblassetcustom.PurchaseDate,
  tblassetcustom.Warrantydate,
  tblassets.Mac,
  tblassetcustom.Manufacturer,
  tblassetcustom.Model,
  tblassetcustom.Serialnumber,
  tsysIPLocations.IPLocation,
  'CN=' + tblassets.AssetName + ',' + tblADComputers.OU As DN
From tblassets
  Inner Join tblassetcustom On tblassets.AssetID = tblassetcustom.AssetID
  Inner Join tsysassettypes On tsysassettypes.AssetType = tblassets.Assettype
  Inner Join lansweeperdb.dbo.tsysIPLocations On tsysIPLocations.LocationID =
      tblassets.LocationID
  Inner Join lansweeperdb.dbo.tblADComputers On tblassets.AssetID =
      tblADComputers.AssetID
Where tsysassettypes.AssetTypename = 'Windows'
elKastr0nom
#2elKastr0nom Member Original PosterPosts: 7  
posted: 10/28/2021 9:53:51 PM(UTC)
That reports provides "no results found".
Andy.S
#3Andy.S Member Posts: 123  
posted: 10/29/2021 12:12:29 PM(UTC)
You just want to add this line to your select:
Code:
  'CN=' + tblassets.AssetName + ',' + tblADComputers.OU As DN

Active Discussions

Lansweeper ManageEngine ADSelfService Plus Vulnerability
by  TheGift73   Go to last post Go to first unread
Last post: 11/30/2021 10:25:01 AM(UTC)
Lansweeper OS: Not latest Build of Windows 10 not working
by  Luke Maslany  
Go to last post Go to first unread
Last post: 11/29/2021 2:01:49 PM(UTC)
Lansweeper Cannot find right class
by  FabioB   Go to last post Go to first unread
Last post: 11/29/2021 8:16:33 AM(UTC)
Lansweeper vCenter vSphere Web Client Vulnerabilities
by  Esben.D  
Go to last post Go to first unread
Last post: 11/25/2021 12:24:24 PM(UTC)
Lansweeper Report for Hardware Maintenance
by  PBjelly   Go to last post Go to first unread
Last post: 11/23/2021 2:53:33 PM(UTC)
Lansweeper Need a little help here
Belarus  AMcCarron  
Go to last post Go to first unread
Last post: 11/18/2021 3:07:25 PM(UTC)
Lansweeper Solftware Installed by member of AD Group
by  RPZ   Go to last post Go to first unread
Last post: 11/17/2021 9:57:42 PM(UTC)
Lansweeper Uptime Report duplicate powerstates
by  INNO-IT  
Go to last post Go to first unread
Last post: 11/16/2021 5:10:23 PM(UTC)