cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
maciej_przygodz
Engaged Sweeper II
Hello,

I would like to know, how I should to build a custom report to show all locally installed printers on client computer. I'm looking for USB and LPT printers connected to computers. I need this report to create a list of all local printers in company.

I would be grateful if someone could help me to create this custom report.

Regards,

Maciek
1 ACCEPTED SOLUTION
krak
Engaged Sweeper
Updated for LanSweeper 5:
(Only shows USB printers)

Select Top 1000000 tsysOS.Image As Icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysOS.OSname As OS,
tblAssets.SP,
tblAssets.IPAddress As IP,
tblPrinters.Caption As Printer,
tblPrinters.Portname As [Printer Port],
tblPrinters.Capabilitydescriptions As [Printer Capabilities],
tblPrinters.Lastchanged
From tblAssets
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Join tblPrinters On tblAssets.AssetID = tblPrinters.AssetID
Where (tblPrinters.Portname Like 'DOT4%' Or tblPrinters.Portname Like 'USB%')
And tblPrinters.Local = 1
Order By tblAssets.Domain,
tblAssets.AssetName,
tblPrinters.Caption

View solution in original post

8 REPLIES 8
CyberCitizen
Honored Sweeper
Thank you for this, this works well. I am just wondering though is it possible to get the serial numbers of the USB printers or is this information not available?
akantem
Engaged Sweeper
Hi, How do i get all network printers list..

Thanks,
Diddi
oroman
Engaged Sweeper
Hi, What if I wanted to add a column for the USB printers without limiting the report to only computers that have USB printers?
ufficioced
Champion Sweeper
This is very interesting.
I would like to create a report for local and network printer but grouped by model/manufacturer, if possible with a column to navigate to details: for local printers the list of assets that have those printers installed, for network printers the list of those printer-assets.
Do you think this is possible? Can you give me some hint?
Thanks!
Hemoco
Lansweeper Alumni
We would recommend adding criteria to the tblPrinters.Portname expression to filter the "virtual" printers from the report.
markbose
Engaged Sweeper
This works well! If I wanted to pull all of the software based virtual printers off of the list any suggestions? Also it is showing a couple of lan printers that seems odd.
Thanks!
krak
Engaged Sweeper
Updated for LanSweeper 5:
(Only shows USB printers)

Select Top 1000000 tsysOS.Image As Icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tsysOS.OSname As OS,
tblAssets.SP,
tblAssets.IPAddress As IP,
tblPrinters.Caption As Printer,
tblPrinters.Portname As [Printer Port],
tblPrinters.Capabilitydescriptions As [Printer Capabilities],
tblPrinters.Lastchanged
From tblAssets
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Left Join tblPrinters On tblAssets.AssetID = tblPrinters.AssetID
Where (tblPrinters.Portname Like 'DOT4%' Or tblPrinters.Portname Like 'USB%')
And tblPrinters.Local = 1
Order By tblAssets.Domain,
tblAssets.AssetName,
tblPrinters.Caption
Hemoco
Lansweeper Alumni
Please use the report below for the information you are after.
Select Top 1000000 Web40OSName.Compimage As icon, tblComputers.Computername, tblComputers.Computer, tblComputers.Domain, Web40OSName.OSname As OS, Web40OSName.SP, tblComputers.LastknownIP As IP, tblPrinters.Caption As Printer, tblPrinters.Portname As [Printer Port], tblPrinters.Capabilitydescriptions As [Printer Capabilities], tblPrinters.Lastchanged From tblComputers Inner Join Web40OSName On Web40OSName.Computername = tblComputers.Computername Left Join tblPrinters On tblComputers.Computername = tblPrinters.Computername Where tblPrinters.Local = 1 Order By tblComputers.Domain, tblComputers.Computer, tblPrinters.Caption

To use the specified report, do the following:
• Open the Lansweeper configuration console and select Reports & Alerts\Report Builder. Hit the “New” button.
• Copy the SQL code provided and paste it at the bottom of the newly created report, replacing the default SQL code.
• Click somewhere near tblComputers so the new code applies.
• Give the report a “View name” and a “Report name” and hit the “Save” button.
• Double-click on the report in the report list to see its results and export options.