Solved

vbscript WMI error

Posted on 2004-04-19
12
798 Views
Last Modified: 2009-12-16
I have setup a script that pulls the logs off of a group of servers.  The script works on all machines that I have run it on execpt for one.
I have tested it on Win2k and XP servers and it works.  
The server that it will not work on is a Win2k Server.  It has windows scripting installed and is the correct version

The line below is what it errors at
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & servername & "\root\cimv2")

the error that I get is
Microsoft VBScript Runtime Error '800a01ad'
ActiveX component can't create object: GetObject

Is there a reason why it will not work on 1 Win2k server when it works on another?

It is to run on a production server so I can't play around with it too much.

Thanks
Karl

0
Comment
Question by:Karls
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
12 Comments
 
LVL 3

Expert Comment

by:Barkis_
ID: 10857401
Is there any firewall installed or does the servicepaks differ?
Are the servers setup the same way?

..try rebooting the server that's giving you a hard time :-)  (kidding)

/Barkis_

0
 
LVL 41

Expert Comment

by:graye
ID: 10859146
... and an obvious thing to look for...  make sure that WMI is installed and running (the services are "Windows Management Instrumentation" and "Windows Management Instrumention Driver Extensions")
0
 

Author Comment

by:Karls
ID: 10864696
Have done some further testing.  
The script works ok if it is run on a workstation in the domain and pulls the info from the server logs but will not run on the server itself.  
There are firewalls but that shouldn't be an issue as it is running on the server.  Would love to reboot the server with an axe :)

WMI is installed and running.  Both Services are running too.

Regards,
Karl
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 41

Expert Comment

by:graye
ID: 10868139
But wait... you have a firewall running on the server itself?

WMI uses the normal RPC portmapper (135 and 445) with SVCHOST.EXE as the endpoint.  You might wanna check to see if those ports are open
0
 

Author Comment

by:Karls
ID: 10873336
The firewall is not on the server itself.  We use dedicated hardware firewalls.  Besides I can run the script on a remote pc to access the server ok.

Karl
0
 
LVL 41

Expert Comment

by:graye
ID: 10873947
WMI maintains a set of logs... it's usually at C:\WINNT\system32\wbem\Logs

There might be some nugget of information in one of those files...
0
 
LVL 3

Expert Comment

by:Barkis_
ID: 10875752
And you say that the script works on other servers....other w2k-servers even?

And you run the script on the different servers as the same user(admin)?

tip: you don't have to add the {impersonatelevel=impersonate}! as long as you don't run the script on a NT server as it is done by default on w2k servers.

/Barkis
0
 

Author Comment

by:Karls
ID: 10875776
Yep, works on other win2k servers.  
same user.  Works if I bind to the server from a workstation.  Just will not run on the server itself.  

Thanks for the tip.

Karl
0
 
LVL 3

Accepted Solution

by:
Barkis_ earned 500 total points
ID: 10875868
ok, this might be a long shot but  
try running the WMI object browser on the server that's troubeling you.
It may give you an indication wether wmi is set up and is functioning correctly.

/Barkis
0
 
LVL 3

Expert Comment

by:Barkis_
ID: 10875876
wmi object browser is found in the SDK
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question