troubleshooting Question

Win32_Printer Put() Throwing a "Generic Failure" Error

Avatar of Karl Malone
Karl MaloneFlag for United States of America asked on
PowershellPrinters and ScannersWindows 10Windows OS* Drivers
6 Comments1 Solution537 ViewsLast Modified:
We've been trying to deploy a TCP/IP printer to a non-AD-joined machine using PowerShell.

The function we're using is:

Function CreatePrinter {
    $wmi = ([WMIClass]"\\$ComputerName\Root\cimv2:Win32_Printer")
    $Printer = $wmi.CreateInstance()
    $Printer.CreationClassName = "Win32_Printer"
    $Printer.Caption = $PrinterCaption
    $Printer.DriverName = $DriverName
    $Printer.PortName = $PrinterPortName
    $Printer.DeviceID = $PrinterCaption

Open in new window

However, when running Put(), we receive the following error:

Exception calling "Put" with "0" argument(s): "Generic failure "

We've made sure the driver is pointing correctly, the driver is installed, and all of the required parameters are filled in. Interestingly, this works on a local Windows 10 machine using a different printer, but when trying on a different Windows 7 machine using a different printer, it fails.

Any and all help would be greatly appreciated.
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros