Thursday, 20 July 2023

Blocking PowerShell using Group Policy

Environment Information

AD server: Windows 2019 Server
Client PC: Windows 10

Procedure to disable PowerShell access for all users:

  • As a prerequisite, locate the PowerShell exe location. It is by default at the location provide below but just in case, open PowerShell, go to task manager and right click to open file location as shown on the screenshot below.
    File Path: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe



  • Open Group Policy Editor and create a Group Policy Object.

  • Open the GPO editor for the new GPO and go to:
    User Configuration > Policies > Windows Settings > Security Settings > Software Restriction Policies 


  • Right click on Software Restriction Policies and add a new policy.

  • Select to add a new path rule.


  • Add the file path from earlier and apply.

  • Link the GPO to a specific OU and run gpupdate /force on both server and Client device.

  • When next you log on to client device and run PowerShell, the following pop-up should greet your screen:
     


No comments:

Post a Comment

Upgrading Server License using DISM

[Updated Feb 2025]  In this article, we are going to be upgrading a Servers OS from the standard evaluation edition to any other existing ed...