cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dannyboy
Engaged Sweeper II
i am trying to get a report for all pcs but it isnt working it just either gives me all workgroup pcs or all domain i want a report of all pcs regardless of domain
1 ACCEPTED SOLUTION
Daniel_B
Lansweeper Alumni
Moved your forum topic to the report questions section.

tblAssets.Domain contains the domain or workgroup name. If you would like to report on all Windows computers, you only need to filter on tblAssets.Assettype. It will be -1 for Windows computers. Please find an example report below.

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
Case When tblComputersystem.Domainrole > 1 Then 'Server' Else Case
When Coalesce(tblPortableBattery.AssetID, 0) = 0 Then 'Desktop/Unknown'
Else 'Laptop' End End As Type,
tblOperatingsystem.Caption As OS,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Left Join tblOperatingsystem On tblAssets.AssetID = tblOperatingsystem.AssetID
Left Join tblPortableBattery On tblAssets.AssetID = tblPortableBattery.AssetID
Left Join tsysIPLocations On tblAssets.IPNumeric >= tsysIPLocations.StartIP
And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Where tblAssetCustom.State = 1 And tsysAssetTypes.AssetType = -1
Order By tblAssets.Domain,
tblAssets.AssetName

View solution in original post

2 REPLIES 2
dannyboy
Engaged Sweeper II
Thank you that works great
Daniel_B
Lansweeper Alumni
Moved your forum topic to the report questions section.

tblAssets.Domain contains the domain or workgroup name. If you would like to report on all Windows computers, you only need to filter on tblAssets.Assettype. It will be -1 for Windows computers. Please find an example report below.

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
Case When tblComputersystem.Domainrole > 1 Then 'Server' Else Case
When Coalesce(tblPortableBattery.AssetID, 0) = 0 Then 'Desktop/Unknown'
Else 'Laptop' End End As Type,
tblOperatingsystem.Caption As OS,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tsysIPLocations.IPLocation,
tblAssets.Lastseen,
tblAssets.Lasttried
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Left Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Left Join tblOperatingsystem On tblAssets.AssetID = tblOperatingsystem.AssetID
Left Join tblPortableBattery On tblAssets.AssetID = tblPortableBattery.AssetID
Left Join tsysIPLocations On tblAssets.IPNumeric >= tsysIPLocations.StartIP
And tblAssets.IPNumeric <= tsysIPLocations.EndIP
Where tblAssetCustom.State = 1 And tsysAssetTypes.AssetType = -1
Order By tblAssets.Domain,
tblAssets.AssetName