PC Review Forums Newsgroups Windows XP Windows XP WMI WMI for SQL on WIndows XP

Reply

WMI for SQL on WIndows XP

 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average.
Old 21-07-2004, 03:23 AM   #1
BC
Guest
 
Posts: n/a
Default WMI for SQL on WIndows XP


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"



  Reply With Quote
Old 21-07-2004, 01:21 PM   #2
Steve Thompson
Guest
 
Posts: n/a
Default Re: WMI for SQL on WIndows XP

You need to install the SQL Server WMI provider for this code to work. The
install code is located on the SQL Server 2000 CD: x86\other\wmi\setup.exe

It's described in detail here:
http://www.databasejournal.com/feat...cle.php/1503181

Steve
"BC" <someone@microsoft.com> wrote in message
news:%23CHIiJtbEHA.1732@TK2MSFTNGP09.phx.gbl...
> 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"
>
>
>



  Reply With Quote
Old 22-07-2004, 03:11 AM   #3
Bob
Guest
 
Posts: n/a
Default Re: WMI for SQL on WIndows XP

Thanks Steve,

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

Bob
"Steve Thompson" <stevethompson@nomail.please> wrote in message
news:ur2FdWybEHA.216@TK2MSFTNGP10.phx.gbl...
> You need to install the SQL Server WMI provider for this code to work. The
> install code is located on the SQL Server 2000 CD: x86\other\wmi\setup.exe
>
> It's described in detail here:
> http://www.databasejournal.com/feat...cle.php/1503181
>
> Steve
> "BC" <someone@microsoft.com> wrote in message
> news:%23CHIiJtbEHA.1732@TK2MSFTNGP09.phx.gbl...
> > 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"
> >
> >
> >

>
>



  Reply With Quote
Old 28-07-2004, 12:07 PM   #4
Gert E.R. Drapers
Guest
 
Posts: n/a
Default Re: WMI for SQL on WIndows XP

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

GertD@SQLDev.Net

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.

"VogelBsj" <VogelBsj@discussions.microsoft.com> wrote in message
news:3C342D88-3808-48E0-BCDF-784AAB7F3028@microsoft.com...
>
>
>
>
> These are some of the error messages I've found.
>
> S_OK (00000000)
> Returned when a method completes successfully.
>
> E_FILE_EXISTS (80041001)
> Returned when the module configuration file already exists in the
> specified location.
>
> E_NOT_CS_APPLICATION (80041002)
> Returned when the specified IIS Application is not a Commerce Server
> application.
>
> E_FILE_NOT_FOUND (80041003)
> Returned when the module configuration file cannot be found.
>
> E_APP_NOT_FOUND (80041004)
> Returned with the specified IIS Virtual Directory cannot be found.
>
> E_UNHANDLED (80041005)
> Returned when an unhandled error occurs.
>
> E_INVALID_MODULE (80041006)
> Returned when the specified module does not exist.
>
> E_INIT_MOD_INSTALL_FIRST (80041007)
> Returned if the IsBizDesk, AddModule, or RemoveModule methods are called
> before the Init method is called.
>
> E_INVALID_CATEGORY_FOR_MODULE (80041008)
> Returned when an invalid category is specified.
>
> E_IMPROPER_CS_APP (80041009)
> Returned when a configuration inconsistency is detected between Commerce
> Server and IIS. The object must be run locally on the same machine where
> the physical Business Desk files exist.
>
>
>
> "BC" wrote:
>
>> 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"
>>
>>
>>
>>



  Reply With Quote
Old 29-07-2004, 05:22 PM   #5
Viatcheslav V. Vassiliev
Guest
 
Posts: n/a
Default Re: WMI for SQL on WIndows XP

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

"Gert E.R. Drapers" <GertD@SQLDev.Net> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:%23k3RJtNdEHA.2268@TK2MSFTNGP12.phx.gbl...
> 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
>
> GertD@SQLDev.Net
>
> 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.
>
> "VogelBsj" <VogelBsj@discussions.microsoft.com> wrote in message
> news:3C342D88-3808-48E0-BCDF-784AAB7F3028@microsoft.com...
> >
> >
> >
> >
> > These are some of the error messages I've found.
> >
> > S_OK (00000000)
> > Returned when a method completes successfully.
> >
> > E_FILE_EXISTS (80041001)
> > Returned when the module configuration file already exists in the
> > specified location.
> >
> > E_NOT_CS_APPLICATION (80041002)
> > Returned when the specified IIS Application is not a Commerce Server
> > application.
> >
> > E_FILE_NOT_FOUND (80041003)
> > Returned when the module configuration file cannot be found.
> >
> > E_APP_NOT_FOUND (80041004)
> > Returned with the specified IIS Virtual Directory cannot be found.
> >
> > E_UNHANDLED (80041005)
> > Returned when an unhandled error occurs.
> >
> > E_INVALID_MODULE (80041006)
> > Returned when the specified module does not exist.
> >
> > E_INIT_MOD_INSTALL_FIRST (80041007)
> > Returned if the IsBizDesk, AddModule, or RemoveModule methods are called
> > before the Init method is called.
> >
> > E_INVALID_CATEGORY_FOR_MODULE (80041008)
> > Returned when an invalid category is specified.
> >
> > E_IMPROPER_CS_APP (80041009)
> > Returned when a configuration inconsistency is detected between Commerce
> > Server and IIS. The object must be run locally on the same machine where
> > the physical Business Desk files exist.
> >
> >
> >
> > "BC" wrote:
> >
> >> 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"
> >>
> >>
> >>
> >>

>
>



  Reply With Quote
Old 05-08-2004, 03:04 AM   #6
Bob
Guest
 
Posts: n/a
Default Re: WMI for SQL on WIndows XP

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

"Viatcheslav V. Vassiliev" <msnewsgroup@www-sharp.com> wrote in message
news:%23UnURCZdEHA.1356@TK2MSFTNGP09.phx.gbl...
> 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
>
> "Gert E.R. Drapers" <GertD@SQLDev.Net> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
> ÓÌÅÄÕÀÝÅÅ: news:%23k3RJtNdEHA.2268@TK2MSFTNGP12.phx.gbl...
> > 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
> >
> > GertD@SQLDev.Net
> >
> > 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.
> >
> > "VogelBsj" <VogelBsj@discussions.microsoft.com> wrote in message
> > news:3C342D88-3808-48E0-BCDF-784AAB7F3028@microsoft.com...
> > >
> > >
> > >
> > >
> > > These are some of the error messages I've found.
> > >
> > > S_OK (00000000)
> > > Returned when a method completes successfully.
> > >
> > > E_FILE_EXISTS (80041001)
> > > Returned when the module configuration file already exists in the
> > > specified location.
> > >
> > > E_NOT_CS_APPLICATION (80041002)
> > > Returned when the specified IIS Application is not a Commerce Server
> > > application.
> > >
> > > E_FILE_NOT_FOUND (80041003)
> > > Returned when the module configuration file cannot be found.
> > >
> > > E_APP_NOT_FOUND (80041004)
> > > Returned with the specified IIS Virtual Directory cannot be found.
> > >
> > > E_UNHANDLED (80041005)
> > > Returned when an unhandled error occurs.
> > >
> > > E_INVALID_MODULE (80041006)
> > > Returned when the specified module does not exist.
> > >
> > > E_INIT_MOD_INSTALL_FIRST (80041007)
> > > Returned if the IsBizDesk, AddModule, or RemoveModule methods are

called
> > > before the Init method is called.
> > >
> > > E_INVALID_CATEGORY_FOR_MODULE (80041008)
> > > Returned when an invalid category is specified.
> > >
> > > E_IMPROPER_CS_APP (80041009)
> > > Returned when a configuration inconsistency is detected between

Commerce
> > > Server and IIS. The object must be run locally on the same machine

where
> > > the physical Business Desk files exist.
> > >
> > >
> > >
> > > "BC" wrote:
> > >
> > >> 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"
> > >>
> > >>
> > >>
> > >>

> >
> >

>
>



  Reply With Quote
Old 08-08-2004, 09:51 AM   #7
Gert E.R. Drapers
Guest
 
Posts: n/a
Default Re: WMI for SQL on WIndows XP

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.

GertD@SQLDev.Net

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.

"Bob" <someone@microsoft.com> wrote in message
news:uvT6HkpeEHA.2440@tk2msftngp13.phx.gbl...
> 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
>
> "Viatcheslav V. Vassiliev" <msnewsgroup@www-sharp.com> wrote in message
> news:%23UnURCZdEHA.1356@TK2MSFTNGP09.phx.gbl...
>> 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
>>
>> "Gert E.R. Drapers" <GertD@SQLDev.Net> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
>> ÓÌÅÄÕÀÝÅÅ: news:%23k3RJtNdEHA.2268@TK2MSFTNGP12.phx.gbl...
>> > 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
>> >
>> > GertD@SQLDev.Net
>> >
>> > 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.
>> >
>> > "VogelBsj" <VogelBsj@discussions.microsoft.com> wrote in message
>> > news:3C342D88-3808-48E0-BCDF-784AAB7F3028@microsoft.com...
>> > >
>> > >
>> > >
>> > >
>> > > These are some of the error messages I've found.
>> > >
>> > > S_OK (00000000)
>> > > Returned when a method completes successfully.
>> > >
>> > > E_FILE_EXISTS (80041001)
>> > > Returned when the module configuration file already exists in the
>> > > specified location.
>> > >
>> > > E_NOT_CS_APPLICATION (80041002)
>> > > Returned when the specified IIS Application is not a Commerce Server
>> > > application.
>> > >
>> > > E_FILE_NOT_FOUND (80041003)
>> > > Returned when the module configuration file cannot be found.
>> > >
>> > > E_APP_NOT_FOUND (80041004)
>> > > Returned with the specified IIS Virtual Directory cannot be found.
>> > >
>> > > E_UNHANDLED (80041005)
>> > > Returned when an unhandled error occurs.
>> > >
>> > > E_INVALID_MODULE (80041006)
>> > > Returned when the specified module does not exist.
>> > >
>> > > E_INIT_MOD_INSTALL_FIRST (80041007)
>> > > Returned if the IsBizDesk, AddModule, or RemoveModule methods are

> called
>> > > before the Init method is called.
>> > >
>> > > E_INVALID_CATEGORY_FOR_MODULE (80041008)
>> > > Returned when an invalid category is specified.
>> > >
>> > > E_IMPROPER_CS_APP (80041009)
>> > > Returned when a configuration inconsistency is detected between

> Commerce
>> > > Server and IIS. The object must be run locally on the same machine

> where
>> > > the physical Business Desk files exist.
>> > >
>> > >
>> > >
>> > > "BC" wrote:
>> > >
>> > >> 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"
>> > >>
>> > >>
>> > >>
>> > >>
>> >
>> >

>>
>>

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off