deploying dotnet via GPO

Muqaddas Bamne 1 Reputation point
2020-11-20T17:59:52.427+00:00

I would like to deploy DOTNET 4.8 to some machine via GPO. What I have done so far:

On a test GPO - Computer Configuration > Policies > Windows Setting > Scripts > Startup > PowerShell Scripts:

  • selected add and added the .ps1 that is currently on a Network Share (\<shared_path>\Deployment\ps-script-dotnet-install.ps1) that Everyone has full access to.

The script itself is simply: Start-Process -FilePath \<shared_path>\Deployment\ndp48-x86-x64-allos-enu.exe -ArgumentList /q /norestart -Wait -Verb RunAs

I can confirm via RSOP that the policy has been applied to the test device, but dotnet 4.8 is itself not getting installed.

What am I doing wrong? I am incredibly new to PS scripting.

Thanks,

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,395 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Muqaddas Bamne 1 Reputation point
    2020-11-20T18:33:23.907+00:00

    So it would appear that this is because of the execution policy. I am getting this:

    File \<shared_path>\Deployment\ps-script-dotnet-install.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at
    https:/go.microsoft.com/fwlink/?LinkID=135170.

    • CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : UnauthorizedAccess

    I would like to "Bypass" the execution Policy flag by using:

    PowerShell.exe -ExecutionPolicy Bypass -File

    How do I do this within the GPO, there is an option for Script Parameters, but I am not sure how to add the bypass parameter.

    Please help.

    0 comments No comments

  2. Muqaddas Bamne 1 Reputation point
    2020-11-20T19:28:33.513+00:00

    getting this error now:

    Start-Process : A positional parameter cannot be found that accepts argument '/norestart'.
    At \RBI-FS\Shared\Deployment\ps-script-dotnet-install.ps1:1 char:1

    • Start-Process -FilePath \R<shared_path>\Deployment\ndp48-x86-x64-allo ...
    • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterBindingException
    • FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.StartProcessCommand

    please help.

    0 comments No comments

  3. Hannah Xiong 6,276 Reputation points
    2020-11-23T06:13:42.87+00:00

    Hello,

    Thank you so much for posting here.

    As for the group policy issue, firstly we could check whether the configuration is correct and then check whether the GPO is applied or not via running gpresult /h C:\report.html to get a detailed group policy result report.

    As per our description, it seems to be related with powershell scripting issue. So sorry that we are not professional with the PS scripting. If we have any questions about PS scripting, we could turn to the dedicated powershell forum. Below is the link:

    https://learn.microsoft.com/en-us/answers/topics/windows-server-powershell.html

    Thank you so much for your understanding and support.

    Best regards,
    Hannah Xiong

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.