Discussion:
problem : objLocator.ConnectServer returns Access is denied
(too old to reply)
Rudif
2007-05-11 11:32:00 UTC
Permalink
Hello MVPs and all

On launching the vbs script shown below on my computer, I get this error

H:\Sandbox\WMI\vbs\GetBIOSVer-4.vbs(11, 1) SWbemLocator: Access is denied.

My computer is on a domain, while "targetcomputer" is in a workgroup.
"targetcomputeruser" is a local user on "targetcomputer", member of
Administrators group.
Both computers run XP SP2.

Is it possible at all to obtain WMI access in this situation (domain ->
workgroup)?
If yes, what do I need to configure on computers and/or modify in my script ?

I searched msdn and forums and other WMI-related websites for advice, but
what I could find and try did not solve my problem.

I ran WMIDiag.vbs on the target computer and it declared 'Success'.

TIA
Rudif

'----------------------------------------------------------

computer = "targetcomputer"
user = "targetcomputeruser"
password = "targetcomputeruserpwd"

'GetBIOSVer.vbs
'Retrieves the BIOS information from remote computer
Dim ojLocator, objbWMI, colBIOS, clsBIOS
Set objLocator=CreateObject("WbemScripting.SWbemLocator")
Set objWMI=objLocator.ConnectServer(computer, "root\cimv2", user, password)
objWMI.Security_.ImpersonationLevel=3 'Impersonate
Set colBIOS=objWMI.InstancesOf("Win32_BIOS")
For Each clsBIOS in colBIOS
Wscript.Echo "Name: " & clsBIOS.Name
WScript.Echo "SMBIOSBIOSVersion: " & clsBIOS.SMBIOSBIOSVersion
WScript.Echo "SMBIOSMajorVersion: " & clsBIOS.SMBIOSMajorVersion
WScript.Echo "SMBIOSMinorVersion: " & clsBIOS.SMBIOSMinorVersion
Next
'----------------------------------------------------------
Colin Bowern
2007-05-15 15:37:31 UTC
Permalink
Start here:

Connecting to WMI on a Remote Computer
http://msdn2.microsoft.com/en-us/library/aa389290.aspx

and let us know if you continue to have problems. It sounds like you are
missing an access control entry in the WMI security for the user you are
using. There is a specific ACE for "Remote Enable" which likely needs to be
set.

Cheers,
Colin
Post by Rudif
Hello MVPs and all
On launching the vbs script shown below on my computer, I get this error
H:\Sandbox\WMI\vbs\GetBIOSVer-4.vbs(11, 1) SWbemLocator: Access is denied.
My computer is on a domain, while "targetcomputer" is in a workgroup.
"targetcomputeruser" is a local user on "targetcomputer", member of
Administrators group.
Both computers run XP SP2.
Is it possible at all to obtain WMI access in this situation (domain ->
workgroup)?
If yes, what do I need to configure on computers and/or modify in my script ?
I searched msdn and forums and other WMI-related websites for advice, but
what I could find and try did not solve my problem.
I ran WMIDiag.vbs on the target computer and it declared 'Success'.
TIA
Rudif
'----------------------------------------------------------
computer = "targetcomputer"
user = "targetcomputeruser"
password = "targetcomputeruserpwd"
'GetBIOSVer.vbs
'Retrieves the BIOS information from remote computer
Dim ojLocator, objbWMI, colBIOS, clsBIOS
Set objLocator=CreateObject("WbemScripting.SWbemLocator")
Set objWMI=objLocator.ConnectServer(computer, "root\cimv2", user, password)
objWMI.Security_.ImpersonationLevel=3 'Impersonate
Set colBIOS=objWMI.InstancesOf("Win32_BIOS")
For Each clsBIOS in colBIOS
Wscript.Echo "Name: " & clsBIOS.Name
WScript.Echo "SMBIOSBIOSVersion: " & clsBIOS.SMBIOSBIOSVersion
WScript.Echo "SMBIOSMajorVersion: " & clsBIOS.SMBIOSMajorVersion
WScript.Echo "SMBIOSMinorVersion: " & clsBIOS.SMBIOSMinorVersion
Next
'----------------------------------------------------------
m***@gmail.com
2012-08-28 15:57:08 UTC
Permalink
Post by Rudif
Hello MVPs and all
On launching the vbs script shown below on my computer, I get this error
H:\Sandbox\WMI\vbs\GetBIOSVer-4.vbs(11, 1) SWbemLocator: Access is denied.
My computer is on a domain, while "targetcomputer" is in a workgroup.
"targetcomputeruser" is a local user on "targetcomputer", member of
Administrators group.
Both computers run XP SP2.
Is it possible at all to obtain WMI access in this situation (domain ->
workgroup)?
If yes, what do I need to configure on computers and/or modify in my script ?
I searched msdn and forums and other WMI-related websites for advice, but
what I could find and try did not solve my problem.
I ran WMIDiag.vbs on the target computer and it declared 'Success'.
TIA
Rudif
'----------------------------------------------------------
computer = "targetcomputer"
user = "targetcomputeruser"
password = "targetcomputeruserpwd"
'GetBIOSVer.vbs
'Retrieves the BIOS information from remote computer
Dim ojLocator, objbWMI, colBIOS, clsBIOS
Set objLocator=CreateObject("WbemScripting.SWbemLocator")
Set objWMI=objLocator.ConnectServer(computer, "root\cimv2", user, password)
objWMI.Security_.ImpersonationLevel=3 'Impersonate
Set colBIOS=objWMI.InstancesOf("Win32_BIOS")
For Each clsBIOS in colBIOS
Wscript.Echo "Name: " & clsBIOS.Name
WScript.Echo "SMBIOSBIOSVersion: " & clsBIOS.SMBIOSBIOSVersion
WScript.Echo "SMBIOSMajorVersion: " & clsBIOS.SMBIOSMajorVersion
WScript.Echo "SMBIOSMinorVersion: " & clsBIOS.SMBIOSMinorVersion
Next
'----------------------------------------------------------
Were you ever able to figure this issue out? I'm in the EXACT same boat and have been beating my head into a wall for a couple weeks now trying to figure it out.
Loading...