Community FAQ
cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 
1louis
Engaged Sweeper

I have the following report 

Select Top (1000000) tsysOS.Image As icon,
tblAssets.AssetID,
tblADComputers.IsEnabled As Enabled,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblADComputers.ManagerADObjectId As [Server Owner],
tblADComputers.Description As Description,
tblAssetCustom.Model,
tsysIPLocations.IPLocation,
tsysOS.OSname As OS,
tblAssets.Firstseen As [Created at],
tblAssets.Lastseen As [Last successful scan],
tblADObjects.ADObjectID
From tblComputersystem
Inner Join tblAssets On tblComputersystem.AssetID = tblAssets.AssetID
Inner Join tblOperatingsystem On
tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Outer Join tsysIPLocations On tsysIPLocations.LocationID =
tblAssets.LocationID
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblADObjects On tblADObjects.ADObjectID = tblADComputers.ADObjectID
Where tblComputersystem.Domainrole > 1 And tblAssetCustom.State = 1
Order By tblAssets.AssetName

when it runs it shows just a number in the tblADComputers.ManagerADObjectId As [Server Owner],

I have tried to link this to AD group as we have a AD security group not user name

what is the best way to get this work ?

1 REPLY 1
rinks
Champion Sweeper

The field tblADComputers.ManagerADObjectId stores the Object ID (GUID) of the manager in Active Directory, which is usually a user, not a group. In your case, since you're assigning ownership to an AD security group, this creates a mismatch — Lansweeper expects a user reference but you've set a group.

To resolve or work around this, here are your options:
If the AD group you’ve assigned as "Manager" is synced into Lansweeper (i.e., it exists in tblADObjects), you can try joining tblADComputers.ManagerADObjectId to tblADObjects.ADObjectID like this:

Left Join tblADObjects As mgrObj On tblADComputers.ManagerADObjectId = mgrObj.ADObjectID

Then in your SELECT:
mgrObj.Displayname As [Server Owner]

Update your current SELECT line:
tblADComputers.ManagerADObjectId As [Server Owner],

to: 
mgrObj.Displayname As [Server Owner],

Second Option: 

Since AD's manager field is designed for user objects, not groups, it’s better to use Lansweeper’s Custom fields or Comments to store the server owner info if it's a group.

  1. Add a custom field (e.g., AssetOwner) using:

    • Go to Asset Management > Assets > Edit Asset > Custom Fields.

    • Use one of the 20 available custom fields like Custom1, and repurpose it as ā€œServer Ownerā€.

  2. Modify your report to include:
    tblAssetCustom.Custom1 As [Server Owner]

    This avoids the GUID lookup entirely and allows you to store any string (group name, email, etc.).

Updated report to test:

Select Top (1000000)
tsysOS.Image As icon,
tblAssets.AssetID,
tblADComputers.IsEnabled As Enabled,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,

-- Option 1: Resolve ManagerADObjectId to Display Name (works if group/user is synced)
mgrObj.Displayname As [Server Owner from AD],

-- Option 2: Use Custom Field for server owner name or group (manually set)
tblAssetCustom.Custom1 As [Server Owner (Custom)],

tblADComputers.Description As Description,
tblAssetCustom.Model,
tsysIPLocations.IPLocation,
tsysOS.OSname As OS,
tblAssets.Firstseen As [Created at],
tblAssets.Lastseen As [Last successful scan],
tblADObjects.ADObjectID

From tblComputersystem
Inner Join tblAssets On tblComputersystem.AssetID = tblAssets.AssetID
Inner Join tblOperatingsystem On tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Join tsysIPLocations On tsysIPLocations.LocationID = tblAssets.LocationID
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Inner Join tblADObjects On tblADObjects.ADObjectID = tblADComputers.ADObjectID

-- Join to resolve ManagerADObjectId to a readable name
Left Join tblADObjects As mgrObj On tblADComputers.ManagerADObjectId = mgrObj.ADObjectID

Where tblComputersystem.Domainrole > 1
And tblAssetCustom.State = 1
Order By tblAssets.AssetName

------------------------------------------------
Union Home Mortgage's "Lansweeper Guy"
------------------------------------------------

Reports & Analytics

Ask about reports you're interested in and share reports you've created. Subscribe to receive daily updates of reports shared in the Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now