Announcement

Collapse
No announcement yet.

Group Policy - Running batch script with an administrative command line

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Group Policy - Running batch script with an administrative command line

    Hi All

    I am trying to run a batch script via Group Policy that does the following
    net stop wuauserv
    rename c:\windows\SoftwareDistribution softwaredistribution.old
    net start wuauserv

    Steps 1 and 3 work fine but on Step 2 I get an Access Denied message when the policy is executed. The same happens when I run the batch file manually.

    When I manually run the batch file, with an elevated command line, it works.

    Is there a way I could execute an elevated command line through the GPO?

    Thanks
    Ivan

  • #2
    Re: Group Policy - Running batch script with an administrative command line

    Hello. I would start by running this as a computer policy logon script.
    Secondly you may need to disable UAC.
    Please remember to award reputation points if you have received good advice.
    I do tend to think 'outside the box' so others may not always share the same views.

    MCITP -W7,
    MCSA+Messaging, CCENT, ICND2 slowly getting around to.

    Comment


    • #3
      Re: Group Policy - Running batch script with an administrative command line

      I concur. Run the script as a Startup script instead of a Logon script. That way it will execute under the System account.
      Regards,
      Jeremy

      Network Consultant/Engineer
      Baltimore - Washington area and beyond
      www.gma-cpa.com

      Comment


      • #4
        Re: Group Policy - Running batch script with an administrative command line

        yes, running it as startup script shoud solve the problem. And after all, it is not a 'user' issue, it is a computer configuration.
        You do not have to disable UAC, the System account is not subject to UAC.


        Alternatively, (if you insist using a user configuration gpo) you can use use GPP to schedule the script to run it 'at every logon', providing the credentials of an service account and run it with the highest priveledges.



        /Rems
        Last edited by Rems; 20th August 2013, 11:11.

        This posting is provided "AS IS" with no warranties, and confers no rights.

        __________________

        ** Remember to give credit where credit's due **
        and leave Reputation Points for meaningful posts

        Comment


        • #5
          Re: Group Policy - Running batch script with an administrative command line

          Thank you all for your replies, it is much appreciated

          Comment

          Working...
          X