Re: Remote run Script issue

Tech-Archive recommends: Speed Up your PC by fixing your registry



bobgfish wrote:

Trying to run a simple utility to change the drive letter of the CD ROM. The script runs fine when running locallly. However if I try and run it remotely by changing the strComputer name I get an Access Denied message. This happens on the .Put_ line. Ideas? I think it is something in Group Policy as I've removed the machine from the domain and it then works.

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Probably your impersonation string. Try this:

impersonationLevel=impersonate,(Security)}!

or perhaps:
impersonationLevel=impersonate,(MachineAccount)}!

or maybe even both:
impersonationLevel=impersonate,(Security,MachineAccount)}!


There are other privileges that you might need too. Take a look here:

http://www.microsoft.com/technet/scriptcenter/guide/sas_wmi_vzbp.mspx?mfr=true


--
Cheers,

Chris.
.



Relevant Pages

  • Re: Need Help..
    ... strComputer, strName, strModel, etc. works, then I can only guess the ... this part of the script is working. ... The part where we must add disconnected computers to the database i can't ... Dim strComputerName ' The Computer Name to be queried via WMI ...
    (microsoft.public.windows.server.scripting)
  • Re: Loop with out Do
    ... Set objLog = ... & vbNewLine & vbNewLine ... Also, strComputer will never be False, but ... When I fixed the problems in the second script, ...
    (microsoft.public.windows.server.scripting)
  • Re: VBScript and Out Put to Excel Worksheet
    ... removed them from the list and now the script works. ... Dim strComputer, strDN ... On Error GoTo 0 ...
    (microsoft.public.windows.server.scripting)
  • RE: This script wont run on a workgroup server
    ... Set objService = objLocator.ConnectServer(strComputer, "Root\Default", ... strUser, strPassword) ... > I have this script that I use on domain member servers and it runs just fine. ... > strPassword = objExplorer.Document.Body.All.UserPassword.Value ...
    (microsoft.public.scripting.wsh)
  • Re: Modifiy this script to read a nested "Computers" container
    ... I ran the below script and received the following error. ... There are computer accounts in both the top level OU called Site1 and ... ' input: strComputer ... Sub GetLocalAdmins ...
    (microsoft.public.scripting.wsh)