Janssen
2007-05-10 20:34:01 UTC
Hello,
I'm tyring to setup a new printer on a computer using WMI and Powershell.
I'm using the following code:
$c = [WMICLASS]"root\cimv2:Win32_Printer"
$c.AddPrinterConnection("Test Printer")
This returns:
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ReturnValue : 1801
I checked MSDN, and the return Value 1801 signifies "Invalid Name". I've
tried all different manners of strings, and tried on multiple computers, but
I always get the same return. Does anyone have any ideas on this one?
Thanks in advance.
Janssen
I'm tyring to setup a new printer on a computer using WMI and Powershell.
I'm using the following code:
$c = [WMICLASS]"root\cimv2:Win32_Printer"
$c.AddPrinterConnection("Test Printer")
This returns:
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ReturnValue : 1801
I checked MSDN, and the return Value 1801 signifies "Invalid Name". I've
tried all different manners of strings, and tried on multiple computers, but
I always get the same return. Does anyone have any ideas on this one?
Thanks in advance.
Janssen