WMI for SQL on WIndows XP

B

BC

Hi,

I am trying to run some vbscripts on my computer, but I always get the
following failure.

Can anybody suggest a way out of this problem?
TIA
Bob

The Error popup contains

Script: small.vbs

Line: 4

Char: 1

Error: 0x80041002

Code: 80041002

Source: null

I am running SQL server 2000 with the WMI installed and service pack 3
applied on a Windows XP Pro machine with SP1 applied.

THe script is:

sComputer = "QEMS-02" '-- name of the computer where SQL Server is installed

sSQLServer = "QEMS-02" '-- name of the SQL server instance

wscript.echo "Before instance"

set oInstance = GetObject("winmgmts:{impersonationLevel=impersonate}//" & _

sComputer & "/root/MicrosoftSQLServer:MSSQL_SQLServer.Name=" & _

Chr(34) & sSQLServer & Chr(34))

wscript.echo "After instance"
 
B

Bob

Thanks Steve,

But the error turned out to be that sSQLSERVER needs to be set to "(LOCAL)"

Bob
 
G

Gert E.R. Drapers

The error comes from WMI, saying that "The requested instance could not be
found."

Error Result : 0x80041002 ( -2147217406 )
ID Defined as : WBEM_E_NOT_FOUND
Error Type : OLE HRESULT Error
Facility : FACILITY_ITF 0x00000004 ( 4 )
Severity : SEVERITY_ERROR 0x00000001 ( 1 )
Code : 0x00001002 ( 4098 )
Source Error file : Errors from WBEMcli.h
Message Text : WBEM (Web Based Enterprise Management) SDK Error

(e-mail address removed)

Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright © SQLDev.Net 1991-2004 All rights reserved.
 
V

Viatcheslav V. Vassiliev

Do you have WMI provider for MS SQL Server installed? It is not installed
with MS SQL Server and is located on CD, in CD:\x86\other\wmi directory.

//------------------------------------
Regards,
Vassiliev V. V.
http://www-sharp.com -
Scripting/HTA/.Net Framework IDE
 
B

Bob

The error turned out to be related to the install of SQL.
Because I am using developer edition, the instance is "(LOCAL)"
Once I found out that piece of information - the script worked
 
G

Gert E.R. Drapers

This has nothing to do with the edition of SQL Server, this is simply a
default instance opposed to a named instance, on the same machine you can
access a default instance using (local) and a named instance using
(local)\instance name, you can also use the hostname or machine name.

(e-mail address removed)

Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright © SQLDev.Net 1991-2004 All rights reserved.
 

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

Top