Hi,
Thank you for posting in our forum. According to your description, I feel that this problem is more likely to be a scripting problem. I recommend you to post to the scripting forum, they can give you more professional help
Best wishes
Vicky
Running PS over GP as admin
Hello,
I have a powershell script which installs network vpn settings and is working fine when it is run with admin priviledges on Windows 10.
However when I create Group Policy and add script to Computer Configuration -> Windows Settings -> Scripts -> PowerShell Scripts it would not install. I am guessing this could have something to do with running it as admin? I have verified via Rsop that GP does apply on the computer.
Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other
4 answers
Sort by: Most helpful
-
Vicky Wang 2,741 Reputation points
2020-09-30T09:21:19.513+00:00 -
Marius Kulikauskas 21 Reputation points Microsoft Employee
2020-09-29T14:45:07.993+00:00 That is exactly what I did. Placed PS script under
Computer Configuration\Policies\Windows Settings\Scripts (Startup/Shutdown)\PowerShellBut it would not run. I tried also following with no luck
Delay script
Computer Configuration -> Administrative Templates -> System -> Group Policy section. Enable the “Configure Logon Script Delay”
Turn on Script execution
Administrative Templates -> Windows Components -> Windows PowerShellNot even sure where to look for logs why it failed to upload PS script..
-
Vicky Wang 2,741 Reputation points
2020-09-25T09:04:48.48+00:00 Hi,
Just want to confirm the current situations.
Please feel free to let us know if you need further assistance.
Best Regards,
Vicky -
Vicky Wang 2,741 Reputation points
2020-09-23T08:39:28.93+00:00 Any user configuration items, including login scripts are run with the user's permissions. In order to run a script (or software installation) with elevated permissions you need to either run it using Computer configuration, which will run as local system, or use group policy preferences to create a scheduled task and configure the desired credentials.
I was able to make it work by putting the script inside the path (inside the GPO):Computer Configuration\Policies\Windows Settings\Scripts (Startup/Shutdown)
In it, the script runs as administrator by the system, doing the installation.
Hope this information can help you
Best wishes
Vicky