Re: Problem "Getting" an object

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

From: Peter Falz (pf.ms.news_at_asp-solutions.de)
Date: 01/11/05

  • Next message: Peter Falz: "Re: using wmi trough the firewalls"
    Date: Tue, 11 Jan 2005 18:35:15 +0100
    
    

    Hi vish,

    mmh, please post your code.
    Without the code, nobody here can help you, also not the
    "Magic 8ball" ;-)

    Bye
    Peter

    "vish" <itsmedude@gmail.com> schrieb im Newsbeitrag news:1105463734.062384.320580@f14g2000cwb.googlegroups.com...
    > Hi,
    > I have a question regarding the WMI scripts. I've written WMI code
    > integrated into ASP. What it does is that it connects to the remote
    > computers in the lab and gets the whole inventory list (it gets the
    > info about each computer like hard disk capacity, free space, OS,
    > version etc..etc...). Everything works fine for me but it takes too
    > long to give me the result. For example, I have around 80 machines in
    > the lab and it takes around 9 minutes to give me the result. Is there
    > any other way that I can reduce the time and get the response quicker.
    >
    > Any help is appreciated.
    >
    > Thanks,
    > vish.
    >
    > Peter Falz wrote:
    > > Hi TroubleMan,
    > >
    > > "TroubleMan" <TroubleMan@discussions.microsoft.com> schrieb im
    > Newsbeitrag
    > > news:51845C27-C3E1-47A2-8D5C-DB36A4AE424B@microsoft.com...
    > > > Not sure if getting an object by any other property besides the Key
    > property
    > > > is legal but here is my question
    > > >
    > > > ***Why does this work
    > > > Set objWMI = GetObject("winMgmts:")
    > > > Set refService = objWMI.Get("Win32_Service.Name='Spooler'")
    > > > With refService
    > > > Wscript.Echo .Caption
    > > > Wscript.Echo .State
    > > > End With
    > > >
    > > > ***But this does not
    > > > Set objWMI = GetObject("winMgmts:")
    > > > Set refService = objWMI.Get("Win32_Service.DisplayName='Print
    > Spooler'")
    > > Maybe it is not named "Print Spooler". I cannot test this with "Print
    > Spooler"
    > > because in german it is named as "Druckwarteschlange", but i've
    > tested this with this
    > > word in CIM Studio and it works fine.
    > >
    > > Try this:
    > > ...
    > > Set refService = objWMI.Get("Win32_Service.Name='Spooler'")
    > > With refService
    > > Wscript.Echo .DisplayName
    > > ...
    > >
    > > Use the output of this property and it should wok also for you.
    > > Set refService =
    > objWMI.Get("Win32_Service.DisplayName='[DisplayName]'")
    > >
    > > HTH
    > >
    > > Bye
    > > Peter
    >


  • Next message: Peter Falz: "Re: using wmi trough the firewalls"

    Relevant Pages

    • RE: Start / Stop spooler
      ... Using WMI might get you where you need to go. ... printer spooler as well. ... and it runs fine when an admin (local admin on the ...
      (microsoft.public.windows.terminal_services)
    • Re: 8004100E: The namespace specified could not be found
      ... Peter Falz wrote: ... > is WMI on these computers installed and ready to work? ... > The article you by click on the link belongs to NT4, ... > Maybe recompile the MOFs at the problematic system's. ...
      (microsoft.public.win32.programmer.wmi)
    • Thats exactly what I wanted!
      ... "Peter Falz" wrote: ... >> According to books, if I installed the Platform SDK and WMI SDK I thought I ...
      (microsoft.public.win32.programmer.wmi)