Scott -
On W2K3 SP1 I can change the location with no error from wbemtest but the location does not really get changed. If I reopen the instance it is back to the original setting.
I didn't find the original script but cloned one from "Scriptomatic" It works on SP1 and XP. Now I will test it on W2K and W2K3.
Here is the script.- be careful where you run it from as it will re-locate every printer it finds.
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
arrComputers = Array(".")
For Each strComputer In arrComputers
WScript.Echo
WScript.Echo "=========================================="
WScript.Echo "Computer: " & strComputer
WScript.Echo "=========================================="
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Printer", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
WScript.Echo "Attributes: " & objItem.Attributes
WScript.Echo "Location: " & objItem.Location
objItem.Location = "Hello World!"
objItem.Put_
objItem.Location = "Hello World!"
Next
Next
--
Jim Vierra
I was only using the default install no custom mof files or anything like that. Specifically I was using Win32_Printer in the root\cimv2 namespace and wbemtest.exe as the client.
If you can track down the code and post it. I can take another look for you...
--
Scott McNairy
Microsoft MVP - Windows Server Management Infrastructure
Hi Scott
On W2K3, 3 systems checked, I get an "unsupported" on the "Put_". If you need I will track down the code. I don't have it at my fingertips just now.
What MOF and WINCIM32 are you running on W2K3. Perhaps that is the issue?
I have not tested on SP1 as of this date.
--
Jim Vierra
I have it working on both of these OS's WinXP and Win2k3SP1.
Can you describe in more detail the problem you are having on Win2k3?