ok getting closer. I can get the first portion of the code to work but during the second part I get the following error message:
Exception calling "Put" with "0" argument(s): "Generic failure "
At line:1 char:19
+ $objNewPrinter.Put <<<< ()
+ CategoryInfo : NotSpecified: (
[], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Below is the code that I am using to get this working.
$objPrint = [WMICLASS]"Win32_Printer"
$objPrint.psbase.scope.options.EnablePrivileges = $true
$objNewPrinter = $objPrint.createInstance()
$objNewPrinter.DeviceID = "Rhyne_235A_02"
$objNewPrinter.DriverName = "TOSHIBA e-STUDIO3510cSeriesPLC6"
$objNewPrinter.PortName = "Toshiba_3510C"
$objNewPrinter.Shared = $false
$objNewPrinter.Put()
thanks,
wbrost