RE: Permission Denied when trying to access remote computer with VBScr



I am having a simular problem with a remote script.
I am using the following to access the Services on a remote 2000 Server.
The server is not part of a domain. The script work fine from an XP
workstation, Another standalone 2000 Server, and a 2003 AD controller. It
will not work from a 2003 server that is in a workgroup.
I get:

Error: Access is denied
Code: 80070005
Source: swbbemlocator

'//////////////////////////////////////////////////////////////////////////////
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer,
"root\cimv2", strUser, strPassword)
objSWbemServices.Security_.authenticationLevel =
WbemAuthenticationLevelPktPrivacy

Set objSWbemObject = objSWbemServices.Get(strService)

Wscript.Echo "Name: " & objSWbemObject.Name & vbCrLf & _
"Display Name: " & objSWbemObject.DisplayName & vbCrLf & _
"Start Mode: " & objSWbemObject.StartMode & vbCrLf & _
"Pre-State: " & objSWbemObject.State
'//////////////////////////////////////////////////////////////////////////////



"ricardo" wrote:

> hello,
>
> i'm writing a script that access WMI on a remote computer to perform certain
> actions. i've tried using the GetObject as follows:
>
>
> Set objWMIService = GetObject _
> ("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" & _
> strComputerName & "\root\cimv2")
>
> and i've also tried using whe sWbemLocator ConnectServer method as follows:
>
> Set objSWbemLocator = CreateObject("WbemScripting.sWbemLocator")
> Set objWMIService = objSWbemLocator.ConnectServer(strComputerName, _
> "\root\CIMV2", _
> strUser, _
> strPassword, _
> "MS_409", _
> "NTLMDomain:" + strComputerName)
>
> when i use the first method, i get
> error code: 800A0046
> Error: Permission denied: 'GetObject'
> System: the remote server has been paused or is in the process of being
> started.
>
> when i use the second method, i get:
> error Code: 80070005
> Error: Access is denied
> Source: SWbemLocator
> System: Access is denied
>
> the remote computer is a Windows XP sp2, i'm running a network with a
> windows 2003 domain controler. i'm running the script as a domain
> administrator.
> i have searched all around on a way to fix this. i have followed all
> instructions in how to set securiy and impersonation level, and access level,
> and still my scripts error out.
> i suspect that some recent windows update is blocking access to local wmi
> from the network.
> all the variables are declared explicitly and are assigned values before
> reaching this part of the code.
> i have disabled the firewall on the local machines using a gpo, so it's not
> a firewall issue.
> if i'm locally on the machine, all the scripts run without a problem. it's
> only remotely that i have a problem.
>
> thanks and regards,
>
>
.



Relevant Pages

  • Re: Remote office logon script - Long Delay
    ... Windows IP Configuration ... If I point the User's profile to a script that doesn't contain the ... I do not have WINS configured for the remote site, ... This remote server was built using connect computer script, ...
    (microsoft.public.windows.server.sbs)
  • Re: Remote office logon script - Long Delay
    ... Windows IP Configuration ... If I point the User's profile to a script that doesn't contain the ... I do not have WINS configured for the remote site, ... This remote server was built using connect computer script, ...
    (microsoft.public.windows.server.sbs)
  • Re: Remote office logon script - Long Delay
    ... Windows IP Configuration ... If I point the User's profile to a script that doesn't contain the ... I do not have WINS configured for the remote site, ... is a GC/AD server with DNS and DHCP for it's area. ...
    (microsoft.public.windows.server.sbs)
  • Re: DBI Performance Issues
    ... use the cpu or the network hardware during remote tests. ... first the live script is run from a sun solaris machine using ... server machine. ...
    (comp.lang.perl.misc)
  • Re: Running a script on a remote computer (different domains)
    ... Try and use SWbemLocator for connecting to WMI: ... Set objSWbemLocator = CreateObject ... Use of included script samples are subject to the terms specified at ... > i need to run a script on remote computers. ...
    (microsoft.public.win32.programmer.wmi)