Using EMI for remote printer info
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Using EMI for remote printer info

 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming
Author Message
Conic Ellipse
Guest





Posted: Wed Dec 22, 2004 8:21 pm    Post subject: Using EMI for remote printer info Reply with quote

Howdy all. I used Scriptomatic to create a script that will show me all about
printers installed on a machine using WMI. The script works on my machine,
but when I try to use it on another workstation on my enterprise, I only get
information about 'software' printers on the machine and not the network
printers they have attached to them. Again, I can see the network printers
when I run it on mine, but not on theirs (by putting in their machine name in
place of the . for the strComputer name while running the script on my
computer.)

Remote servers actually show correct information. It appears to be just
workstations that are not working.

Any ideas on how I can correctly get the data from the 'remote' workstations?

Thanks, here's a snipet from the Scriptomatic:

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Printer",,48)
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "DriverName: " & objItem.DriverName
Wscript.Echo "ShareName: " & objItem.ShareName
Next

If it matters, it is failing on remote machines using Windows 2000 up to SP4
AND Windows XP SP1 and 2.

-=Conic=-
Back to top
Conic Ellipse
Guest





Posted: Wed Dec 22, 2004 8:53 pm    Post subject: RE: Using WMI for remote printer info Reply with quote

Sorry, that should be WMI not EMI.

-=Conic=-
Back to top
Corné Bogaarts
Guest





Posted: Fri Dec 24, 2004 1:28 am    Post subject: Re: Using EMI for remote printer info Reply with quote

From the results you describe, I get the impression that you're
getting the printers that are installed on the computer, not the ones
that are connected.
You may have to use a different WMI-object to get the desired results.


On Wed, 22 Dec 2004 06:21:01 -0800, "Conic Ellipse"
<ConicEllipse@discussions.microsoft.com> wrote:

Quote:
Howdy all. I used Scriptomatic to create a script that will show me all about
printers installed on a machine using WMI. The script works on my machine,
but when I try to use it on another workstation on my enterprise, I only get
information about 'software' printers on the machine and not the network
printers they have attached to them. Again, I can see the network printers
when I run it on mine, but not on theirs (by putting in their machine name in
place of the . for the strComputer name while running the script on my
computer.)

Remote servers actually show correct information. It appears to be just
workstations that are not working.

Any ideas on how I can correctly get the data from the 'remote' workstations?

Thanks, here's a snipet from the Scriptomatic:

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Printer",,48)
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "DriverName: " & objItem.DriverName
Wscript.Echo "ShareName: " & objItem.ShareName
Next

If it matters, it is failing on remote machines using Windows 2000 up to SP4
AND Windows XP SP1 and 2.

-=Conic=-

--- --- --- --- --- --- ---
Most answers can be found in the Schedule+ FAQ: http://www.xs4all.nl/~bogaarts/schdmenu.htm.
Please reply to the newsgroup. For reasons of Spam, I won't be including my E-mail address anymore.
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB