Failed to initialize all required WMI classes

F

freshbojan28

HI!!! Situation:
I 've opened right click "My Computer" icon, select "Manage", expand
"Services and
Applications", select "WMI Control", right click and select
"Properties"
I've received following error message:

Failed to initialize all required WMI classes.
Win32_Processor: WMI: Access denied
Win32_WMISetting: Sucessful Security information
: Sucessful
Win32_OperatingSystem : WMI : Access denied

I've tried this scipt:

set lctr = CreateObject("WbemScripting.SW­bemLocator")
set svc = lctr.ConnectServeR(".", "root")
set obj = svc.get("__namespace.name='cim­v2'")
set svc = getObject("winmgmts:root\cimv2­")
set obj = svc.get("Win32_Process")
set oEnum = svc.execQuery("Select * from win32_process")


and I am receiving folowing error:

Error: ActiveX component can't create object
'Wbemscripting.Sw-BemLocator'
Code: 800a01Ad
Source: MS Vbscript runtime error

I must add that mashine is DC,file server,exchange 2003 server.I am
receving also event errors:9099 Souce: MSEXCHANGESA
Can You help?
Regards
Bojan
 
P

Peter Falz

Hi freshbojan28,

are you loggedin as "Administrator"? If not, try this.
I don't mean an user with adminstrative rights. I mean
the user "Administrator" itself.

Bye
Peter


HI!!! Situation:
I 've opened right click "My Computer" icon, select "Manage", expand
"Services and
Applications", select "WMI Control", right click and select
"Properties"
I've received following error message:

Failed to initialize all required WMI classes.
Win32_Processor: WMI: Access denied
Win32_WMISetting: Sucessful Security information
: Sucessful
Win32_OperatingSystem : WMI : Access denied

I've tried this scipt:

set lctr = CreateObject("WbemScripting.SW­bemLocator")
set svc = lctr.ConnectServeR(".", "root")
set obj = svc.get("__namespace.name='cim­v2'")
set svc = getObject("winmgmts:root\cimv2­")
set obj = svc.get("Win32_Process")
set oEnum = svc.execQuery("Select * from win32_process")


and I am receiving folowing error:

Error: ActiveX component can't create object
'Wbemscripting.Sw-BemLocator'
Code: 800a01Ad
Source: MS Vbscript runtime error

I must add that mashine is DC,file server,exchange 2003 server.I am
receving also event errors:9099 Souce: MSEXCHANGESA
Can You help?
Regards
Bojan
 
P

Peter Falz

Hi freshbojan28,
set lctr = CreateObject("WbemScripting.SW­bemLocator")
however this can be, but after i've copied this line in my editor,
i see this:
set lctr = CreateObject("WbemScripting.SW-bemLocator")

So, that everyone can see this i put manually the sign "-" in the word.
You have betwwen the "W" and the "b" a unvisivle sign. This in
HEX "AD" and will be interpreted as "-" and so we can explain
the errormessage:
Error: ActiveX component can't create object
'Wbemscripting.Sw-BemLocator'

Try this line instead of your original line:
set lctr = CreateObject("WbemScripting.SWbemLocator")
set svc = lctr.ConnectServeR(".", "root")
set obj = svc.get("__namespace.name='cim­v2'")

Here is the same as above, what i see in my editor
an HEX "AD" between "m" and "v":
set obj = svc.get("__namespace.name='cim-v2'")
Take this:
set obj = svc.get("__namespace.name='cimv2'")
set svc = getObject("winmgmts:root\cimv2")

Here is the same as above, what i see in my editor
an HEX "AD" after the "2":
set svc = getObject("winmgmts:root\cimv2-")
Take this:
set svc = getObject("winmgmts:root\cimv2")
set obj = svc.get("Win32_Process")
set oEnum = svc.execQuery("Select * from win32_process")


I post here the corrected version. I tested this and it works
without an error, but also with no result, because you no output
programmed:

set lctr = CreateObject("WbemScripting.SWbemLocator")
set svc = lctr.ConnectServeR(".", "root")
set obj = svc.get("__namespace.name='cimv2'")
set svc = getObject("winmgmts:root\cimv2")
set obj = svc.get("Win32_Process")
set oEnum = svc.execQuery("Select * from win32_process")

HTH

Bye
Peter
 
F

freshbojan28

Hello Peter
I've changed the first line so the script looked like :

set lctr = CreateObject("WbemScripting.SWbemLocator")
set svc = lctr.ConnectServeR(".", "root")
set obj = svc.get("__namespace.name='cim­­v2'")
set svc = getObject("winmgmts:root\cimv2­­")
set obj = svc.get("Win32_Process")
set oEnum = svc.execQuery("Select * from win32_process")



After starting the script I received the following error:

Line: 3
Char: 1
Error: Not found
Code: 80041002
Source: SWbemServicesEx

Anyway must add that that I am not script programer, i found mine
script at google,some MCVP wrote it and I thought if I started the
script it will help me to resolve or diagnose the wmi problem:

Failed to initialize all required WMI classes.
Win32_Processor: WMI: Access denied
Win32_WMISetting: Sucessful Security information
: Sucessful
Win32_OperatingSystem : WMI : Access denied

Thanx anyway Peter
Bojan
 
P

Peter Falz

Hi Bojan,

i've copied also these lines in my editor and yes, i'm right,
i see this signs again, which we all cannot see here in this posting.
I've tried this also with notepad and it happens the same.

And if i run these lines it get the same error as you. Line 3, ... ... ...

Copy the following lines and replace your old lines in your file. The
best is: don't try to change your code:

set lctr = CreateObject("WbemScripting.SWbemLocator")
set svc = lctr.ConnectServeR(".", "root")
set obj = svc.get("__namespace.name='cimv2'")
set svc = getObject("winmgmts:root\cimv2")
set obj = svc.get("Win32_Process")
set oEnum = svc.execQuery("Select * from win32_process")

What do you do that you get a non-visible sign in your sourcecode?

Related to you errormessages with "Access Denied": Where do you
get these messages?

Which OS do you use?

HTH

Bye
Peter
 
F

freshbojan28

Peter my man i am running script on WIN2K3 SP1
Domain controler,Exchnager server and File server mashine
Last script u gave me also gave error:

Line: 5
Char: 34
Error: Unterminated string constant
Code: 800A0409
Source: MS Vbscript runtime error


WMI messages i get when i right click "My Computer" icon, select
"Manage", expand
"Services and
Applications", select "WMI Control", right click and select
"Properties"
I've received following error message:


Failed to initialize all required WMI classes.
Win32_Processor: WMI: Access denied
Win32_WMISetting: Sucessful Security information
: Sucessful
Win32_OperatingSystem : WMI : Access denied


peace
bojan
 
P

Peter Falz

freshbojan28 said:
Peter my man i am running script on WIN2K3 SP1
Maybe you are one of the victims of SP1. You're not the
only one who have problems related to WMI after installing SP1
on a W2K3-Server.
Domain controler,Exchnager server and File server mashine
Last script u gave me also gave error:
Line: 5
Char: 34
Error: Unterminated string constant
Code: 800A0409
Source: MS Vbscript runtime error
On my systems:
- W2K-Server (non DC), ... ...
- W2K3-Server (DC), Exchange Server, ... ...
this script works fine.

This errermessage means, that a sign is missing. IMO the ".
But if have Copy/Paste the code, this should not happen.
Nevertheless, this is not your real problem.
WMI messages i get when i right click "My Computer" icon, select
"Manage", expand
"Services and
Applications", select "WMI Control", right click and select
"Properties"
I've received following error message:
Failed to initialize all required WMI classes.
Win32_Processor: WMI: Access denied
Win32_WMISetting: Sucessful Security information
: Sucessful
Win32_OperatingSystem : WMI : Access denied
I don't get these message. In my case the display of the properties-
windows works also fine.

How i've said before, IMO SP1 is the problem and
AFAIK there is no solution found till now.
AFAIK SP1 changes the security settings seems like
SP2 of XP.

Bye
Peter
 
B

Brandon McCombs

Peter said:
Maybe you are one of the victims of SP1. You're not the
only one who have problems related to WMI after installing SP1
on a W2K3-Server.

I've seen this w/o having SP1 installed but I don't know what causes it. It is due to permissions being messed up in the
Registry I think but I don't know where specifically. I had this problem when I was trying to create a security template for
XP SP1 and eventually was able to create one that didn't cause Access denied to show up in the WMI properties. Sorry I can't
help further. His script is not the issue since even if his script was working WMI itself is not allowing access to begin
with but he does need to fix the script before he could go further.
 

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