Windows 10 - Group Policy - Cannot deploy any scripts, regedit, powershell - etc that requires admin rights


  • Windows 10 and GPO for me has been a nightmare - network drives would not map, had to move the script to call from admin template

    My current battle is trying to use a GPO that will run a powershell or reg edit - even a batch file to edit registry

    Since editing needs admin rights- the GPO will always fail (doesn't do this to me on windows 7)

    I started with a powershell script, but that kept failing due to needing a bypass elevation command

    So I tucked the ps script into a batchfile, to call the ps script with elevation bypassed, now deploying the batch file via computer config/policies/windows settings, scripts, startup/ batchfile call

    still fails - works great on windows 7 - or if I manually run, click "run as admin" while I'm logged in

    doesn't make any sense, if I'm domain admin and have access to GPO, why isn't GPO running as admin?

    TL;DR - how in the hell do I run Group policy scripts as admin

    Here is the powershell line I would deploy via computer startup script in GPO:

    set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\services\NetBT\Parameters\Interfaces\tcpip* -Name NetbiosOptions -Value 2

    When that failed and never ran(but will in windows 7) I called it with a batch file:

    Powershell.exe -executionpolicy bypass -File \\\netlogon\disable_NETBIOS.ps1

    • Edited by Rderenzy Tuesday, April 25, 2017 6:50 PM
    Tuesday, April 25, 2017 6:09 PM

All replies

  • fixed :)

    I did need the batchfile so I could bypass and allow the execution policy, BUT while testing why the dam PS script didn't work by itself, I was putting in a pause so I could read errors - thus, batch file would call powershell, it would run, but pause at end (even though the policy ran, the pause at the end must not have let it "finalize")

    ugh - too much going on - non stop

    thanks for listening

    Tuesday, April 25, 2017 7:18 PM
  • Hi,

    Was your issue resolved?

    If yes, please mark the helpful reply as answer in order that other community members could find the helpful reply quickly.

    If no, please reply and tell us the current situation in order to provide further help.

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact

    Thursday, April 27, 2017 10:03 AM