Permissions to execute the script


  1.    04 Sep 2009 #1
    AN Guest

    Permissions to execute the script


    Hi All,

    I am using a vbscript to query the WMI classes. The script uses the
    following line ...

    Set objWMIService = GetObject("winmgmts:\\" & sComp & "\root\cimv2")

    On some machines, this vbscript works fine but on some machines this script
    failes giving the following error:

    Permission Denied: GetObject
    Code: 800A0046
    Source: Microsoft VBScript runtime error

    Looks like some issue due to some machine specific setting as the script
    runs fine on some machines.

    Any pointers to resolve this is highly appreciated!


    Rgds
    AN


      My System SpecsSystem Spec

  2.    04 Sep 2009 #2
    Richard Mueller [MVP] Guest

    Re: Permissions to execute the script



    "AN" <an@xxxxxx> wrote in message
    news:uq$0Z5TLKHA.5992@xxxxxx

    > Hi All,
    >
    > I am using a vbscript to query the WMI classes. The script uses the
    > following line ...
    >
    > Set objWMIService = GetObject("winmgmts:\\" & sComp & "\root\cimv2")
    >
    > On some machines, this vbscript works fine but on some machines this
    > script failes giving the following error:
    >
    > Permission Denied: GetObject
    > Code: 800A0046
    > Source: Microsoft VBScript runtime error
    >
    > Looks like some issue due to some machine specific setting as the script
    > runs fine on some machines.
    >
    > Any pointers to resolve this is highly appreciated!
    >
    >
    > Rgds
    > AN
    >
    >
    After research some time ago I found the following regarding connecting to
    remote computers with WMI:

    1. You cannot connect to computer running XP Home.
    2. An NT computer cannot connect to OS later than W2k.
    3. A W2k3 computer cannot connect to Win9x.
    4. To connect to W2k Server SP4 you must set impersonation level to
    Impersonate.
    5. W2k computers must have SP2 to connect to XP or above.
    6. W2k3 can only connect to Win9x and NT if credentials supplied.
    7. To connect to XP or W2k3 you must set authentication level to Pkt.

    I'm not sure when (or if) setting impersonationLevel and authenticationLevel
    is required, but it can't hurt. For best results in all situations, I use
    code similar to:

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

    WMI can also be blocked or corrupted. I have used the following links for
    troubleshooting:

    http://www.microsoft.com/technet/scr.../help/wmi.mspx

    http://support.microsoft.com/kb/875605

    http://www.microsoft.com/technet/scr...es/wmifaq.mspx

    I found the following to enable WMI in the firewall:

    netsh firewall set service remoteadmin enable

    You can rebuild the WMI repository, if you have XP SP2, with the command:

    rundll32 wbemupgd, UpgradeRepository

    The following commands reinstall WMI in the registry:

    winmgmt /clearadap
    winmgmt /kill
    winmgmt /unregserver
    winmgmt /regserver
    winmgmt /resyncperf

    --
    Richard Mueller
    MVP Directory Services
    Hilltop Lab - http://www.rlmueller.net
    --


      My System SpecsSystem Spec

  3.    04 Sep 2009 #3
    Richard Mueller [MVP] Guest

    Re: Permissions to execute the script



    "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in
    message news:OOmH$sWLKHA.6016@xxxxxx

    >
    > "AN" <an@xxxxxx> wrote in message
    > news:uq$0Z5TLKHA.5992@xxxxxx

    >> Hi All,
    >>
    >> I am using a vbscript to query the WMI classes. The script uses the
    >> following line ...
    >>
    >> Set objWMIService = GetObject("winmgmts:\\" & sComp & "\root\cimv2")
    >>
    >> On some machines, this vbscript works fine but on some machines this
    >> script failes giving the following error:
    >>
    >> Permission Denied: GetObject
    >> Code: 800A0046
    >> Source: Microsoft VBScript runtime error
    >>
    >> Looks like some issue due to some machine specific setting as the script
    >> runs fine on some machines.
    >>
    >> Any pointers to resolve this is highly appreciated!
    >>
    >>
    >> Rgds
    >> AN
    >>
    >>
    >
    I probably should mention if you think permissions are the problem, that in
    general you need to be a member of the local administrators group on the
    remote computer in order to retrieve information with WMI remotely. The
    group "Domain Admins" is added to the local administrators group by default
    when the computer is joined to the domain, so if you are member of that
    group you should be fine. Otherwise, the restricted groups feature can be
    used to add other domain groups to the local administrators group of all
    computers.

    --
    Richard Mueller
    MVP Directory Services
    Hilltop Lab - http://www.rlmueller.net
    --


      My System SpecsSystem Spec

  4.    06 Sep 2009 #4
    AN Guest

    Re: Permissions to execute the script


    Thanks so much for taking the time to help!

    I shall try with the authentication level to pkt; hope it works!

    Rgds
    AN


    "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in
    message news:OxR0jQcLKHA.4376@xxxxxx

    >
    > "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in
    > message news:OOmH$sWLKHA.6016@xxxxxx

    >>
    >> "AN" <an@xxxxxx> wrote in message
    >> news:uq$0Z5TLKHA.5992@xxxxxx

    >>> Hi All,
    >>>
    >>> I am using a vbscript to query the WMI classes. The script uses the
    >>> following line ...
    >>>
    >>> Set objWMIService = GetObject("winmgmts:\\" & sComp & "\root\cimv2")
    >>>
    >>> On some machines, this vbscript works fine but on some machines this
    >>> script failes giving the following error:
    >>>
    >>> Permission Denied: GetObject
    >>> Code: 800A0046
    >>> Source: Microsoft VBScript runtime error
    >>>
    >>> Looks like some issue due to some machine specific setting as the script
    >>> runs fine on some machines.
    >>>
    >>> Any pointers to resolve this is highly appreciated!
    >>>
    >>>
    >>> Rgds
    >>> AN
    >>>
    >>>
    >>
    >
    > I probably should mention if you think permissions are the problem, that
    > in general you need to be a member of the local administrators group on
    > the remote computer in order to retrieve information with WMI remotely.
    > The group "Domain Admins" is added to the local administrators group by
    > default when the computer is joined to the domain, so if you are member of
    > that group you should be fine. Otherwise, the restricted groups feature
    > can be used to add other domain groups to the local administrators group
    > of all computers.
    >
    > --
    > Richard Mueller
    > MVP Directory Services
    > Hilltop Lab - http://www.rlmueller.net
    > --
    >
    >

      My System SpecsSystem Spec

  5.    08 Sep 2009 #5
    AN Guest

    Re: Permissions to execute the script


    I tried your steps but still it does not work. Can you please let me know if
    there is something else that i can try out?

    TIA

    AN


    "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in
    message news:OxR0jQcLKHA.4376@xxxxxx

    >
    > "Richard Mueller [MVP]" <rlmueller-nospam@xxxxxx> wrote in
    > message news:OOmH$sWLKHA.6016@xxxxxx

    >>
    >> "AN" <an@xxxxxx> wrote in message
    >> news:uq$0Z5TLKHA.5992@xxxxxx

    >>> Hi All,
    >>>
    >>> I am using a vbscript to query the WMI classes. The script uses the
    >>> following line ...
    >>>
    >>> Set objWMIService = GetObject("winmgmts:\\" & sComp & "\root\cimv2")
    >>>
    >>> On some machines, this vbscript works fine but on some machines this
    >>> script failes giving the following error:
    >>>
    >>> Permission Denied: GetObject
    >>> Code: 800A0046
    >>> Source: Microsoft VBScript runtime error
    >>>
    >>> Looks like some issue due to some machine specific setting as the script
    >>> runs fine on some machines.
    >>>
    >>> Any pointers to resolve this is highly appreciated!
    >>>
    >>>
    >>> Rgds
    >>> AN
    >>>
    >>>
    >>
    >
    > I probably should mention if you think permissions are the problem, that
    > in general you need to be a member of the local administrators group on
    > the remote computer in order to retrieve information with WMI remotely.
    > The group "Domain Admins" is added to the local administrators group by
    > default when the computer is joined to the domain, so if you are member of
    > that group you should be fine. Otherwise, the restricted groups feature
    > can be used to add other domain groups to the local administrators group
    > of all computers.
    >
    > --
    > Richard Mueller
    > MVP Directory Services
    > Hilltop Lab - http://www.rlmueller.net
    > --
    >
    >

      My System SpecsSystem Spec

Permissions to execute the script

Similar Threads
Thread Forum
Execute powershell script at startup
Hi all, Is there a way to lexecute a powershell script at Windows startup ? I would like the script be executed every boot of windows without to...
PowerShell
powershell script to execute simultaneously instead of sequentially
i would like to execute a script to execute the same command to a list of servers, listed in a text file (hopefully later from an excel file),...
PowerShell
Vista/7 permissions for script?
I have almost no experience with Vista but recently started testing my software and scripts on Win7 RC. I'm confused by the permissions issues and...
VB Script
execute Exchange script from DOS - how to get result?
how can I ran this script from a dos batch file and get the exit code? the batch file suppose to do A if the DB is mounted and to do B if not ...
PowerShell
Execute a powershell script from a webpage
Hello, I wonder if it is possible to execute a powershell script and show the result in a the page from a IIS website (6.0 on a W2003 R2 Ent...
PowerShell
execute powershell script from commmand line
How can you execute a powershell script from the commandline. I'd like to go to start > run on a computer and be able to launch a powershell script...
PowerShell
AD LogOn Scripts Execute permissions
Testing Environmet: Ms Virtual Server 2k5 R2 Testing Environment Host OS: Enterprise Server 2k3 x64 Edition Testing Environment Hardware: Intel...
Vista account administration

Our Sites
  • Ten Forums
  • Eight Forums
  • Seven Forums
  • Help Me Bake
  • Site Links
  • Contact Us
  • Privacy and Cookies
  • About Us
    Windows Vista Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    Designer Media Ltd
    All times are GMT -5. The time now is 13:37.
    .