Re: Using EMI for remote printer info

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Corné Bogaarts (does.not.exist_at_bigfoot.com)
Date: 12/23/04


Date: Thu, 23 Dec 2004 20:28:32 +0100


>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:

>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.



Relevant Pages

  • Re: script to install printers based on location attribute
    ... the main body of workstations and printers. ... I don't anticipate any run-time performance issues with this script. ... perform an ADSI query for the UNCNAME attribute of the>> printer and use WMI to install the printer connection to the users> profile. ...
    (microsoft.public.windows.server.scripting)
  • Re: script to install printers based on location attribute
    ... the main body of workstations and printers. ... I don't anticipate any run-time performance issues with this script. ... perform an ADSI query for the UNCNAME attribute of the>> printer and use WMI to install the printer connection to the users> profile. ...
    (microsoft.public.win2000.printing)
  • Re: How to execute remote vbscript
    ... I'm trying to get a list of network mapped printers on all of the ... workstations in our domain and put into a file. ... local vbs script that is trying to be executed and the script from the ... Below script runs and tries to execute a script on each workstation ...
    (microsoft.public.scripting.vbscript)
  • Re: Domain Logon Script Advice
    ... users printers and network shares based upon which Active Directory OU ... I happy with deploying the script via GPO etc, ... A very basic VBScript logon script to map the same printer and shares to all ...
    (microsoft.public.scripting.wsh)
  • Re: Re: Running an OU policy only after a previous OU policy com
    ... > Printers with .vbs logon scripts because regular users don't ... In the Computer Configuration ... > Script and in the User Configuration I put the Same as a Logon ...
    (microsoft.public.win2000.group_policy)