Win32_Printer - AddPrinterConnection - Not Supported on WinXP?

G

Guest

When I use the AddPrinterConnection or SetDefaultPrinter methods on my local
Windows XP machine it works fine.

If I use the same method on a remote machine with the same OS, it fails with
error 0x8004100C (Not Supported). The call fails at 'piServices->ExecMethod'
which seems to means that it doesn't even go the the remote machine.

It doesn't matter if I specify a local or networked printer connection. WMI
is successfully bound to the remote machine using delegation.

Can anyone please help on this? At this stage any suggestions would help!
Thank you.
 
P

Pascal

Alan,

Let me confirm. The WMI Win32_Printer:: AddPrinterConnection and
SetDefaultPrinter are methods which only work when called against the
local machine. Is this correct?

Now if I may ask:

1./ If this documented anywhere?

2./ Why on earth would the 2 most useful Win32_Printer methods become
totally redundant by bounding them to the local machine only? If I want
to change my default printer or add a new printer I use the control
panel, I don't write a WMI script for it.

Can you please CONFIRM that this is indeed the fact? Does Microsoft
plan on changing this in upcoming WMI updates?

Thank you,
Pascal.
GetSetDefault will only work on the local machine.

local only for the add connection

AddPrinterConnection(strPrinter, strUser, strPassword)




--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

Pascal B. said:
When I use the AddPrinterConnection or SetDefaultPrinter methods on
my
local
Windows XP machine it works fine.

If I use the same method on a remote machine with the same OS, it
fails
with
error 0x8004100C (Not Supported). The call fails at 'piServices->ExecMethod'
which seems to means that it doesn't even go the the remote machine.

It doesn't matter if I specify a local or networked printer
connection.
WMI
is successfully bound to the remote machine using delegation.

Can anyone please help on this? At this stage any suggestions would help!
Thank you.
 
A

Alan Morris\(MSFT\)

I guess this is supported but the connection will be created in the WMI user
context.

http://msdn.microsoft.com/library/d.../wmi/creating_a_wmi_application_or_script.asp

How do I... WMI classes or methods
...add a new printer connection to a remote computer? Use the
Win32_Printer class and the AddPrinterConnection method.
Windows 2000/NT and Windows 98/95: The AddPrinterConnection method
is not available.
strComputer = "atl-ws-01"
Set objWMIService = GetObject( _
"winmgmts:{impersonationLevel=Impersonate}!\\" & _
strComputer & "\root\cimv2")
Set colPrinters = objWMIService.Get("Win32_Printer")
errReturn = colPrinters.AddPrinterConnection _)
("\\PrintServer1\ArtDepartmentPrinter")



http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_printer.asp

Set Default is local

The SetDefaultPrinter WMI class method sets the default system printer for
the user calling the method
--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

Pascal said:
Alan,

Let me confirm. The WMI Win32_Printer:: AddPrinterConnection and
SetDefaultPrinter are methods which only work when called against the
local machine. Is this correct?

Now if I may ask:

1./ If this documented anywhere?

2./ Why on earth would the 2 most useful Win32_Printer methods become
totally redundant by bounding them to the local machine only? If I want
to change my default printer or add a new printer I use the control
panel, I don't write a WMI script for it.

Can you please CONFIRM that this is indeed the fact? Does Microsoft
plan on changing this in upcoming WMI updates?

Thank you,
Pascal.
GetSetDefault will only work on the local machine.

local only for the add connection

AddPrinterConnection(strPrinter, strUser, strPassword)




--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/default.aspx?scid=fh;[ln];kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.

Pascal B. said:
When I use the AddPrinterConnection or SetDefaultPrinter methods on
my
local
Windows XP machine it works fine.

If I use the same method on a remote machine with the same OS, it
fails
with
error 0x8004100C (Not Supported). The call fails at 'piServices->ExecMethod'
which seems to means that it doesn't even go the the remote machine.

It doesn't matter if I specify a local or networked printer
connection.
WMI
is successfully bound to the remote machine using delegation.

Can anyone please help on this? At this stage any suggestions would help!
Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top