Hope someone can assist me in this.
I am trying to add a network printer using PowerShell but I keep getting the error:
Exception calling "AddWindowsPrinterConnection" with "1" argument(s): "The
printer name is invalid. (Exception from HRESULT: 0x80070709)"
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
Here is my code:
$PrinterPath =\\server.domain.com\printershareName
$netPrint =new-Object-ComObjectWScript.Network
$netPrint.AddWindowsPrinterConnection ($PrinterPath)
Thanks,
Isaac Oben MCITP:EA, MCSE,MCC <a href="https://www.mcpvirtualbusinesscard.com/VBCServer/4a046848-4b33-4a28-b254-e5b01e29693e/interactivecard"> View my MCP Certifications</a>