473,378 Members | 1,564 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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

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:Permission Denied 'GetObject'
Source:Microsoft VBScript Runtime error
Code:800A0046

Can someone please help me out
Dec 1 '12 #1
15 11313
Rabbit
12,516 Expert Mod 8TB
The most likely cause is that the account doesn't have admin rights on the computer.
Dec 2 '12 #2
Hi Rabbit,

I have Administrator access to the machine., the script is working fine in another server. Can you please let me know if there are some other issues ?
Dec 2 '12 #3
zmbd
5,501 Expert Mod 4TB
Please double check that your effective rights are actually at the Admin level for the folder you're trying to work in.
You'd be surprised how many times an "Admin" doesn't have full rights to a given directory on the server, or on a localPC... I still give my I.T.-Wizard a hard time about that issue, (long story and two days to fix (ROTFL) let's just say, once he added write permissions to his profile for the folder things went much better (chuckle))
Dec 2 '12 #4
Hi zmbd,

I had checked my access on the server., i can manually stop the services ( services.msc , right click on service and stop )., but when i try to execute a script to stop the services i get the above error.

If i dont have proper access i think i cant stop the services even manually.

Can you please let me know if any specific checks i need to perform so that we could confirm that the issue is with access !! Thanks..
Dec 2 '12 #5
Rabbit
12,516 Expert Mod 8TB
You might have local admin rights but do you also have rights to the remote namespace? You would also need to make sure the machine is remote enabled.
Dec 3 '12 #6
Hi Rabbit,

The machine is remote enabled., I checked in , Control Panel-> System-> Remote tab -> Allow users to connect remotely to this computer is checked. Can you please let me know how to check if i have rights to remote namespace ?

Plz note that , I can login the server through Remote desktop connection.
Dec 3 '12 #7
Rabbit
12,516 Expert Mod 8TB
Here is a link to Microsoft's WMI document on troubleshooting. Question 8 talks about permissions for the remote namespace and question 9 talks about additional permissions needed for remote WMI.

http://technet.microsoft.com/library/ee692772.aspx#EEAA
Dec 3 '12 #8
Hi Rabbit,

I had checked the remote namespace - \root\cimv2 ., and i had given me full rights to it (as i am the admin i was able to do it)., and checked if the machine is remote enabled too. Even after then if i try to execute the script i get the same error: Microsoft VBScript Runtime error: ActiveX component can't create object..

The script is working fine in 3 remote servers (windows 2003 Server ) , but not working only in one server., so i am sure there is no error in the script. But couldn't actually figure out the issue as i am a new to this:( Please help me out..
Dec 3 '12 #9
Hi Rabbit,

I had also tried to execute the script from another admin account and the issue seems to persist still :( getting the same error !!

The only difference i can see is that, My Computer-> Manage -> Services & Applications -> WMI Control -> Properties -> Advanced tab. i could see WinMgmt process restart property set as Don't restart and Enable Anonymous connection with share level security is unchecked ., whereas the above options are not present in other servers where the script is working.. Is this the issue ??? In general tab in WMI Control properties i see a message Failed to initialize all required WMI classes. how to initialize the same? Is this the issue?
Dec 3 '12 #10
Rabbit
12,516 Expert Mod 8TB
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
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 Expert Mod 8TB
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 Expert Mod 4TB
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\cimv2") in that something is not resolving correctly <<EDIT<<
Dec 4 '12 #14
Thanks for the link zmbd, i will go through the same, and will keep you posted on the outcome soon.
Dec 5 '12 #15
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
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...
2
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
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...
7
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...
3
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....
1
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...
2
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
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...
1
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....
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.