Solved

vbscript WMI error

Posted on 2004-04-19
12
800 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
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
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.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

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