Solved

vbscript WMI error

Posted on 2004-04-19
12
794 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
  • 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
 
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now