They double checked that they have Administrator rights, the same as me.
Main Topics
Browse All TopicsMore than one customer of mine is reporting a "Permission Denied" error number 70 when the following lines are executed:
Dim objWMIService As Object
Set objWMIService = GetObject("winmgmts:\\.\ro
These two lines are called within the "Class_Initialize" function of a class in an ActiveX DLL of mine.
I cannot reproduce this error on any computer I can get my hands on. Does anyone have any ideas as to:
1) how I can set up my computer to reproduce this problem?
2) how I can fix the bug?
Thanks in advance.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Erick37,
I have never used VBScript; only VB6, C#, C++ 6.0, VBA. Do you have an example I could use to determine whether they can run a WMI at all?
I can try "Set objWMIService = GetObject("winmgmts:root\d
By the way, I have verified with the customer that even though the COM Security tab had "Allow" for all fields, the problem still existed.
They also report that they get the message "Failed to connect to <local computer> because "Win32: Access is denied." when performing step #4 of the following:
1. Right-click on My Computer and click Manage.
2. Double-click Services and Applications and then double-click WMI Control.
3. Right-click WMI Control and then click Properties.
4. In the WMI Control Properties dialog box click the Security tab.
here is a vbscript WMI example :
'-------------------------
Option Explicit
Dim objWMIService, objItem, colItems
Dim strComputer, strList
On Error Resume Next
strComputer = "."
' WMI Connection to the object in the CIM namespace
Set objWMIService = GetObject("winmgmts:\\" _
& strComputer & "\root\cimv2")
' WMI Query to the Win32_OperatingSystem
Set colItems = objWMIService.ExecQuery
("Select * from Win32_OperatingSystem")
' For Each... In Loop (Next at the very end)
For Each objItem in colItems
WScript.Echo "Machine Name: " & objItem.CSName & VbCr & _
"=========================
"Processor: " & objItem.Description & VbCr & _
"Manufacturer: " & objItem.Manufacturer & VbCr & _
"Operating System: " & objItem.Caption & VbCr & _
"Version: " & objItem.Version & VbCr & _
"Service Pack: " & objItem.CSDVersion & VbCr & _
"CodeSet: " & objItem.CodeSet & VbCr & _
"CountryCode: " & objItem.CountryCode & VbCr & _
"OSLanguage: " & objItem.OSLanguage & VbCr & _
"CurrentTimeZone: " & objItem.CurrentTimeZone & VbCr & _
"Locale: " & objItem.Locale & VbCr & _
"SerialNumber: " & objItem.SerialNumber & VbCr & _
"SystemDrive: " & objItem.SystemDrive & VbCr & _
"WindowsDirectory: " & objItem.WindowsDirectory & VbCr & _
""
Next
WSCript.Quit
'-------------------------
Copy and paste the above section between the 2 lines into a text file, rename the txt file extension to .vbs and run it, that will return info about your O/S.
I got that from here :
http://www.computerperform
If you dont see the file extensions of the files then you have to open my computer or within any folder go to :
Tools --> Folder options --> View
Then uncheck the checkbox where it says "Hide extensions for known file types"
I hope this helps :)
Well the customer is unable to get back with me right away. But I did find another way to change the WMI permissions:
Control Panel->Administrative Tools
Double click on Component Services
Double click on Component Services in the new window
Double Click on Computers in the right pane
Double click on My Computer in the right pane
Double click on DCOM Config in the right pane
Right click on "Windows Management and Instrumentation" icon in the right pane
Select Properties
Select the "Security" Tab
Select "Customize" for all three frames
Click on all three "Edit" buttons and make sure each checkbox is "Allow"
If "Deny" is selected the "Permissions Denied" error occurs *even though all* the checkboxes of the Component Services->"My Computer"->"Properties"->[
I haven't got a definitive answer from the customer yet as to whether this latest DCOM WMI permission is the cause, but you guys have steered me in the right direction, I believe. So I would like to split the 500 points between Erick37 and "gecko_au2003". How do I split the points? Do I select "Accept" for both answers?
Business Accounts
Answer for Membership
by: Erick37Posted on 2005-10-05 at 11:08:00ID: 15024200
It sounds like a permissions issue. Perhaps the user does not have sufficient rights on the computer to connect to WMI?