Link to home
Start Free TrialLog in
Avatar of nav2567
nav2567Flag 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.
Avatar of jordanrog
jordanrog
Flag of United States of America image

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

ASKER

It doesnt work.
... or perhaps use ConvertTo-CSV

I don't think that there is anything to convert to XLS (or XLSX) format (other than Excel).
ASKER CERTIFIED SOLUTION
Avatar of jordanrog
jordanrog
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial