Avatar of nav2567
nav2567
Flag for United States of America asked on

get network printer information using powershell command.

Hello,

I am using the following command to get printers information on my print server.

Get-WmiObject win32_printer -computer PRINTSVR1 | ? { $_.type -ne 1 } | sort name | ConvertTo-html -prop Name,DriverName,PortName,Location > c:\printsvr1.html

It works.  However, I am trying to make the output in excel format.  How do I tweak that command to do that?

Please advise.  

Thanks.
Windows Server 2008

Avatar of undefined
Last Comment
jordanrog

8/22/2022 - Mon
jordanrog

I would say that your translating to hmtl so remove the convert to and use  Export-Csv C:\MyFile.Csv
nav2567

ASKER
It doesnt work.
DansDadUK

... or perhaps use ConvertTo-CSV

I don't think that there is anything to convert to XLS (or XLSX) format (other than Excel).
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER CERTIFIED SOLUTION
jordanrog

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question