The pnputil Add only Driver Information, it doesn't add the printer. And I cannot find the correct script (pnputil or Add-Printer, whatever it works) to add the WSD printer.
Adding WSD Printer by Powershell
$DriverInfPath = "C:\Drivers\eb4-ebn-Uni-3264bit-7222541281\UNI\Driver\64bit\eSf6u.inf"
$DriverName = "TOSHIBA Universal Printer 2"
$PrinterName = "TOSHIBA e-STUDIO3508A-123456"
$PortName = "WSD-https://192.168.17.1:50081"
$PortIPAddress = "192.168.17.1"
$WSDPortNumber = 50081
$WSDPort = "WSD"
$DeviceURL = "uuid:fdh40080-4271-1b8a-f123-457c92143fca4" # Replace with the actual DeviceURL
$DeviceUUID = "fdh40080-4271-1b8a-f123-457c92143fca4" # Replace with the actual DeviceUUID
Start-Process -FilePath "pnputil.exe" -ArgumentList "/add-driver "$DriverInfPath" /install" -Wait
With the above information, how can I add a WSD printer with Powershell?
Thank you.
Windows for business | Windows Server | User experience | PowerShell
2 answers
Sort by: Most helpful
-
-
Limitless Technology 45,051 Reputation points
2023-06-22T13:35:43.1233333+00:00 Hello there,
To add a WSD (Web Services for Devices) printer using PowerShell, you can utilize the Add-Printer cmdlet. Here's an example of how to do it:
$printerName = "YourPrinterName"
$driverName = "YourPrinterDriverName"
$portName = "WSD-12345678-1234-1234-1234-123456789012" # Replace with your specific WSD port name
Add-Printer -Name $printerName -DriverName $driverName -PortName $portName
Make sure to replace the placeholders with the appropriate values:
$printerName: Specify the desired name for the printer.
$driverName: Provide the name of the printer driver. You can retrieve this by checking the installed printer drivers on your system or obtaining it from the printer manufacturer's documentation.
$portName: Replace with the specific WSD port name associated with the printer. You can find the port name by going to "Devices and Printers" in the Control Panel, selecting the printer, right-clicking on it, and choosing "Printer properties." Under the "Ports" tab, locate the port name starting with "WSD-" followed by a series of numbers and letters.
I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.
Hope this resolves your Query !!
--If the reply is helpful, please Upvote and Accept it as an answer--