/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


how to get printers list

08/10/2020 235 views

Hello guys and gals. 

I am trying to show printers list on a computer.

I am able to accomplish the action with a custom inventory rule and I added below;

ShellCommandTextReturn(powershell Get-WMIObject Win32_Printer -recurse  | Select-Object systemname, Name, PortName, drivername )

above works and shows the list of printers. 

the problem is it trims the output and looks like below


systemname Name PortName drivername
---------- ---- -------- ----------
16V27V1 Send To OneNote 2010 nul: Send To Mi...
16V27V1 ricoh 7502 10.2.90.244 Gestetner ...
16V27V1 PDFCreator pdfcmon PDFCreator
16V27V1 Microsoft XPS Document Writer XPSPort: Microsoft ...
16V27V1 Fax SHRFAX: Microsoft ...
16V27V1 CAD Zone PDF CPWPT001: CUSTPDF Wr...
16V27V1 Academy - room 222 - HP LaserJet 4250 PCL6 10.2.90.233 HP LaserJe..


How do I get the values show full length?


thanks in advance.


It seems, windows 10 pro showing the values in full length but not on windows 7. I still have the same problem and need help

Answer Summary:
0 Comments   [ + ] Show comments

Comments

  • This content is currently hidden from public view.
    Reason: Removed by member request For more information, visit our FAQ's.

Answer Chosen by the Author

2

Try piping"| Format-Table -AutoSize" to the command. If that does not work, maybe "| Format-Table -Wrap".

Answered 08/12/2020 by: mtatro
Yellow Belt

  • Thank you mtatro. this was awesome.

All Answers

This content is currently hidden from public view.
Reason: Determined to be spam through moderation For more information, visit our FAQ's.
This content is currently hidden from public view.
Reason: Member has been banned from the site SPAMMER For more information, visit our FAQ's.
0

Your subject line should read "Powershell script truncates printer list under Windows 7"

Also...Windows SEVEN?!? In 2020?!? W.O.W.

Answered 08/12/2020 by: VBScab
Red Belt

  • vbscab,

    Yes I know about windows 7. we still have about 400 pcs with it. and we are slowly upgrading them to win10.

    thank you for your comment.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ