By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,044 Members | 1,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,044 IT Pros & Developers. It's quick & easy.

"Automation server can't create Objects" error while accessing the WMI scripts from Linux box

P: n/a
I have an implementation issue with WMI scripts to check the user
machine processor. The implementation is working fine in the local
machine (Windows XP operating system). It is throwing script error in
the DEV environment (Application deployed in the linux box).

Following is the javascript code to detect the processor,

function detectProcessor()
{
var locator = new ActiveXObject
("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
var properties = service.ExecQuery(" SELECT * FROM
WIN32_Processor");
var e = new Enumerator (properties);
for (;!e.atEnd();e.moveNext ())
{
var processor = e.item ();
alert("Processor : " +processor.Name);
}
return processor.Name;
}
When the application is deployed in the linux environment, and the
application invokes the detectProcessor() method, the browser throws an
error message as "Error : Automation server can't create object". (It
fails at the time of ActiveX creation) The above implementation is not
able to create the activeX component in the client machine.

I tried an alternate way as follows:
<object id='locator'
classid='clsid:76A64158-CB41-11D1-8B02-00600806D9B6'>
</object>

The above class id is for the built-in activeX
("WbemScripting.SWbemLocator") in the client windows OS Machine
function detectProcessor(){
var service = locator.ConnectServer();
var properties = service.ExecQuery(" SELECT * FROM
WIN32_Processor");
var e = new Enumerator (properties);
for (;!e.atEnd();e.moveNext ())
{
var processor = e.item ();
alert("Processor : " +processor.Name);
}
return processor.Name;
}
This time the browser throws an exception that "the object doesn't have
the method or support the functionality". This time, the activeX
reference is pointed by the system. It failed to create the service. I
copied the view source code of the browser and saved into a
TestWin.html file. When I opened the html file in the local system, the
function executed without any problems.

Please reply if you know any resolution on this.
Thanks in advance
Krishnakumar

Jul 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I got a fix on that. This was not related with linux - windows problem.
It was security related problem in the IE. The activeX's were not able
to create their instances in the client side because of the IE security
settings. By default, IE doesnt allow to create the active-X
components(eg WBEMLocator) written in winscripts.

we have to make the url as "Trusted". In the menu, Tools -->
InternetOptions --Security --TrustedSites. Click "Sites" and enter
the url in the text box , click add. Now the winscript will executed in
the client machine without any error.

Thanks
Krishnakumar

dr*******@gmail.com wrote:
I have an implementation issue with WMI scripts to check the user
machine processor. The implementation is working fine in the local
machine (Windows XP operating system). It is throwing script error in
the DEV environment (Application deployed in the linux box).

Following is the javascript code to detect the processor,

function detectProcessor()
{
var locator = new ActiveXObject
("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
var properties = service.ExecQuery(" SELECT * FROM
WIN32_Processor");
var e = new Enumerator (properties);
for (;!e.atEnd();e.moveNext ())
{
var processor = e.item ();
alert("Processor : " +processor.Name);
}
return processor.Name;
}
When the application is deployed in the linux environment, and the
application invokes the detectProcessor() method, the browser throws an
error message as "Error : Automation server can't create object". (It
fails at the time of ActiveX creation) The above implementation is not
able to create the activeX component in the client machine.

I tried an alternate way as follows:
<object id='locator'
classid='clsid:76A64158-CB41-11D1-8B02-00600806D9B6'>
</object>

The above class id is for the built-in activeX
("WbemScripting.SWbemLocator") in the client windows OS Machine
function detectProcessor(){
var service = locator.ConnectServer();
var properties = service.ExecQuery(" SELECT * FROM
WIN32_Processor");
var e = new Enumerator (properties);
for (;!e.atEnd();e.moveNext ())
{
var processor = e.item ();
alert("Processor : " +processor.Name);
}
return processor.Name;
}
This time the browser throws an exception that "the object doesn't have
the method or support the functionality". This time, the activeX
reference is pointed by the system. It failed to create the service. I
copied the view source code of the browser and saved into a
TestWin.html file. When I opened the html file in the local system, the
function executed without any problems.

Please reply if you know any resolution on this.
Thanks in advance
Krishnakumar
Jul 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.