cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
murpmic
Engaged Sweeper III
I have a report which lists assets that are not in groups other than the default. As we image computers and add them I then have to see what types aren't in groups and the move to the asset page where I can mass import them in those types in to groups. Can you help me modify the report so that I can add devices from this report directly rather than have to toggle to the asset page to add them?


Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.IPAddress,
tblAssets.Firstseen,
tblAssets.Lastseen,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.Username,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join (Select Top 1000000 tblAssetGroupLink.AssetID,
Count(tblAssetGroupLink.AssetGroupID) As Count
From tblAssetGroupLink
Group By tblAssetGroupLink.AssetID) SubQuery1 On SubQuery1.AssetID =
tblAssets.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Where tblAssetCustom.State = 1 And SubQuery1.Count = 1
Order By tblAssets.IPNumeric
1 REPLY 1
Hemoco
Lansweeper Alumni
Reports only list data; they don't allow you to edit data. To edit asset groups, you need to write a script based on the tblAssetGroupLink database table. The sample script below adds any active assets that only belong to the Default Group to the group with group ID 1.
INSERT into tblAssetGroupLink (tblAssetGroupLink.AssetID, tblAssetGroupLink.AssetGroupID)

Select Top 1000000 tblAssets.AssetID,
'1'
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join (Select Top 1000000 tblAssetGroupLink.AssetID,
Count(tblAssetGroupLink.AssetGroupID) As Count
From tblAssetGroupLink
Group By tblAssetGroupLink.AssetID) SubQuery1 On SubQuery1.AssetID =
tblAssets.AssetID
Where tblAssetCustom.State = 1 And SubQuery1.Count = 1

You need to replace what we've marked in bold with your own group ID and execute the script in the Configuration/Scanning Setup/Database Scripts section of the Lansweeper web console. We recommend performing a database backup before executing any scripts. For a list of group names and group IDs, run the report below.
Select Top 1000000 tblAssetGroups.AssetGroupID,
tblAssetGroups.AssetGroup
From tblAssetGroups