Enable PowerShell Constrained Language Mode
in Scripts / Security / PowerShell
This script will set an environment variable on the system to enable PowerShell Constrained Language Mode. It will alter your servers ability to operate PowerShell and should be tested before implementing into your production environment.
This script will set an environment variable on the system to enable PowerShell Constrained Language Mode.
This can also be achieved using Microsoft GPP to implement and Environment Variable.
Open up PowerShell as an Administrator on the system you wish to lock and run the below commands. Be sure to restart all PowerShell sessions after you have run the script.
[Environment]::SetEnvironmentVariable('__PSLockdownPolicy', 4, 'Machine')