?
Solved

vbscript WMI error

Posted on 2004-04-19
12
Medium Priority
?
803 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
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.
Suggested Courses

771 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