Vbscript in ASP

M

MonkFish

Hi, I am extremely new to this ASP thing </apology>

I would like to use many of the server control scripts that I have taken
from the script centre on ASP pages. Whenever I try to use a script I always
get an error at the GetObject line, E.g.

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"
& strComputer & "\root\cimv2")

The error is usually along the lines of

error '80041003'
/ADScripts/test.asp, line 14

Is it possible to host these scripts on IIS5 or do I have to find some other
way?

For background: I would like to enter the IP address of a server and get the
list of installed services and their status.

Regards, Don.
 
A

Aaron Bertrand [MVP]

You can't use WMI in an ASP page that allows anonymous access. You have to
set up Windows Authentication (or, against most sane suggestions, give IUSR
admin rights or change the identity of the app/site to be an admin).
 
M

MonkFish

Thanks Aaron, this put me on the right track and I got a few scripts up and
running! However, I am still getting a lot of very descriptive errors such
as:

"error '80041003'"

Can you point me to a site where I can learn the lot? -- from configuring
the server (my server is locked down and I'm not sure if I need to enable
any features) to writing the scripts in such a way that they work ;o)

BTW the error is spawned by the line:

Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=Impersonate}!\\" & strComputer & "\root\cimv2")

Thanks again.

Regards, Don.
 
A

Aaron Bertrand [MVP]

"error '80041003'"

Sounds like you are *still* running an ASP page that is executing as the
anonymous user, or an authenticated user equivalent to a peon... you need to
have elevated privileges to run this script. See
http://www.perfhound.com/installation.asp for details on two alternative
ways to set this up. Also, if your WMI script is trying to obtain
information from other machines in the network, the namespace must be remote
enabled.
Can you point me to a site where I can learn the lot?

The WMI error codes are not documented very well (I had to troubleshoot
pretty much singlehandedly while writing some of the portions of PerfHound).
The most help I had was from the Lavy/Meggitt book "WMI" from New Riders.

If you want more specific help, you will probably be better off in a
WMI-specific group rather than ASP.

A
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,139
Messages
2,570,805
Members
47,356
Latest member
Tommyhotly

Latest Threads

Top