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 Marking/Flagging VIP Customers
by  C Johnson   Go to last post Go to first unread
Last post: Yesterday at 11:43:22 PM(UTC)
Lansweeper Office 2016 key scanning
by  WaldoIT  
Go to last post Go to first unread
Last post: Yesterday at 3:40:41 PM(UTC)
Lansweeper Configuring SSL in IIS Express issue
by  saffo   Go to last post Go to first unread
Last post: Yesterday at 9:57:31 AM(UTC)
Lansweeper MDM Jamf School
by  Eugene  
Go to last post Go to first unread
Last post: 12/3/2021 6:21:44 PM(UTC)
Lansweeper HTTPS not secure
by  Luke Maslany   Go to last post Go to first unread
Last post: 12/3/2021 2:23:28 PM(UTC)
Lansweeper Problem with deploy software
by  Max90  
Go to last post Go to first unread
Last post: 12/3/2021 2:04:12 PM(UTC)
Lansweeper scanning target by range
by  Colombini   Go to last post Go to first unread
Last post: 12/3/2021 12:06:19 PM(UTC)
Lansweeper Log WIFI networks
by  BastiOn  
Go to last post Go to first unread
Last post: 12/3/2021 10:29:38 AM(UTC)