473,836 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Permission denied 'GetObject' - ActiveX component can't create object

11 New Member
Hi,

I am trying to write a script to stop services automatically in a Windows server 2003 R2. i am having a text file with the server name and services name and use the concept of array for stopping all the services.,


Sample script as follows,

Expand|Select|Wrap|Line Numbers
  1. Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & splitArray(0) & "\root\cimv2") 'Computer name
  2. Set colItems = objWMIService.ExecQuery("Select * from Win32_Service where DisplayName = '" & splitArray(1) & "'") 'Service name
  3. For Each objItem in colItems
But when i execute the script from the 32-bit server i get the error,
Microsoft VBScript Runtime error (at the line For loop in the script): ActiveX component can't create the object.

When i tried to execute the same script from 64-bit server , i get the error,

Error:Permissio n Denied 'GetObject'
Source:Microsof t VBScript Runtime error
Code:800A0046

Can someone please help me out
Dec 1 '12
15 11380
Rabbit
12,516 Recognized Expert Moderator MVP
What is the environment of the server that is running the script and what is the environment of the remote server that the script is running against?
Dec 3 '12 #11
rajavemu
11 New Member
The script is working fine in one Windows Server 2003 R2., but not working in another. Is it due to the fact that the server has failed to initialize all required WMI classes (as seen in WMI Control properties ) which is creating this issue !!
Dec 4 '12 #12
Rabbit
12,516 Recognized Expert Moderator MVP
That didn't answer my question but it sounds like you found the issue. Please share how you resolved it for anyone else that may run into this issue.
Dec 4 '12 #13
zmbd
5,501 Recognized Expert Moderator Expert
Finally, enough information to offer you a possible solution!

You need to read thru the following as there are just too many variables that without "hands-on" your servers I cannot even begin to list all them nor tell you how to make sure that they are all set correctly to authenticate your script.
I highly advise that you follow thru on all of the hyperlinks provided within the page, especially the connection to remote computers and administration rights: WMI Tasks: Computer Harware

Basically, YOU do NOT have sufficient Credentials and Authentication to the server!!!

It doesn't matter that you think you do... as far as the OS is concerned YOU do NOT have the correct access rights to run the script on that server via remote - period.
>>EDIT>> I suspect that the issue may be within line1 of the posted code: }!\\" & splitArray(0) & "\root\cimv 2") in that something is not resolving correctly <<EDIT<<
Dec 4 '12 #14
rajavemu
11 New Member
Thanks for the link zmbd, i will go through the same, and will keep you posted on the outcome soon.
Dec 5 '12 #15
rajavemu
11 New Member
I would like to thank Rabbit and zmbd for quick replies and great support in resolving this issue.

This issue is due to the fact that in the server it has failed to initialize all required WMI classes., and had reported this issue with network team and once this issue is resolved, the script was working fine. Thanks guys for all your help :)
Dec 7 '12 #16

Sign in to post your reply or Sign up for a free account.

Similar topics

2
6009
by: CJM | last post by:
I'm building an ASP app that uses Windows Authentication (IWA). I have an authentication routine that assesses if & how the user can use the application (see code snippet below). Users of a particular group have full permissions (configured via IIS) and all other users have read/execute permissions. When I call the authentication page from the server on my own PC, everything seems to work, but I guess this is not a respresentative...
2
7119
by: sonu | last post by:
I am tring to create activexobject like var Fo =new ActiveXObject("Scripting.FileSystemObject"); but i am finding error that automation server cant create object any help
1
2763
by: Alex Shirley | last post by:
Hi We have various machines with Windows 2000 Pro and Windows XP Pro. Note all machines have Office XP Pro installed + Outlook 2003 We have a Microsoft Access 2002 database that sends out mails via MAPI.Session though Outlook 2003. On some machines the mail gets sent out no problem, but the PC which have recently have had the OS reinstalled (XP and 2000) get the error
7
10002
by: Munsifali Rashid | last post by:
Hi, I've built a webservice in C# that can add public folders to Exchange. There's also a component built in VB6 which references the Outlook 10 (XP) DLL, so I can change the default form being used to post to a public folder. The component works fine when instantiated from a Windows script, but when using it from COM Interop in an ASP.NET web application it errors when trying to execute oNs.GetNameSpace("MAPI"). The error it throws...
3
2963
by: Steve Richter | last post by:
running a simple vbscript in an .htm page that starts excel and loads the spreadsheet with the contents of a <table> ... </table> getting an "Error: ActiveX component cant create object. Excel.Application" error. <script language="vbscript"> Sub TableToExcel_onclick Dim sHTML, oExcel, oBook sHTML = document.all.item("DataGrid1").outerHTML
1
2144
by: erotikaboi | last post by:
Guys, Firstly let me say I am a photographer so if you can offer me a solution I will really appreciate it in simple english not techiespeak as I wont understand it. Thanks. Ok, I am using Access from the Office XP suite on a pentium 4 running WinXP Home. We have a database which has been running successfully for approx 12 months now. Suddenly when I tried to generate a report or query using a wizard I get the mssg "Active X cant create...
2
2655
by: sysadmin | last post by:
Hi Iam trying to install MRP 9000 on windows xp professional.I get an error that activex component cannot create object-error in error routine. Can you help me in fixing it? thanks
1
1471
by: vanessak | last post by:
Hi , I have been trying to use wizards in Access to create new tables and quieries etc but everytime I try, this message pops up. I have tried removing and reinstalling the program but nothing seems to work. Please help.
1
1742
by: mahesh123 | last post by:
Hi Folks, I am getting an Error "Activex Component Cannot Create Object" While I am exporting the Data from the MSFlexgrid to the MS Excel. Here In my Client System MSOffice is not Installed. Please, guide me in the Installing and creating the Depending files of the MS Excel. Thanks ----------- S.N.Mahesh
1
4211
by: jdub33 | last post by:
I have a web project that used a vb6 class library. The asp page would call a createobject() to access the class library. I recently updated the vb6 class library to .net2005. I unregistered the old class library and registered the new .net dll using regasm using /codebase and registered the dll in the GAC. I can access the dll using a vbscript that just does this: dim o set o = createobject( "DataAccess_NET.DataAccess" ) Wscript.Echo...
0
9810
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10527
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10575
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9358
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6975
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5642
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5812
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4001
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3102
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.