Tags

Howto (51) Free Software (35) Powershell (33) Windows Server (23) AD (16) Hyper-V (16) Exchange (13) Office (13) Group Policy (10) Windows Server 2012 (9) Scripts (7) Symantec BE (5) Windows 8 (5) Cisco (4) TMG (4) Terminal Server (4) Cluster (3) HP (3) RDS (3) UAG (3) Citrix (2) DC (2) DNS (2) IE10 (2) OpenID (2) PKI (2) SCVMM (2) Windows Live (2) iLO (2) Backup (1) DPM (1) Fileserver (1) IE (1) SQL; DPM (1) Security (1) Sharepoint (1) Switch (1) VMWare (1) Veeam (1)

dinsdag 21 oktober 2014

Uitleg PS Execution Policy

In de GPO WinRM had ik tijdelijk even een setting toegevoegd, welke ervoor zorgt dat alle server die deze policy krijgt de Execution policy ingesteld wordt op “Allow only signed scripts”.
Op een server die deze policy nu krijgt zie je bij “Get-ExecutionPolicy – list” dat de scope “MachinePolicy” op AllSigned staat.
De MachinePolicy wordt gezet door de GPO en gaat boven alle andere scopes.
Het is daardoor niet mogelijk zoals je hieronder ziet om de executionpolicy op het systeem zelf aan te passen.
Via de Get-Help zie je dat je de ExecutionPolicy een aantal waardes kunt instellen:
Valid values are:               
-- Restricted: Does not load configuration files or run scripts. "Restricted" is the default.                
-- AllSigned: Requires that all scripts and configuration files be signed by a trusted publisher, including scripts that you write on the local computer.               
-- RemoteSigned: Requires that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher.               
-- Unrestricted: Loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.                
-- Bypass: Nothing is blocked and there are no warnings or prompts.               
-- Undefined: Removes the currently assigned execution policy from the current scope. This parameter will not remove an execution policy that is set in a Group Policy scope.
Stel NOOIT maar dan ook NOOIT de Executionpolicy in op Unrestricted (en zeker niet op Bypass), de minimale setting moet zijn RemoteSigned!
Lokale scripts worden dan gewoon uitgevoerd, echter scripts die gedownload zijn niet (of ze moeten gesigned zijn).
Windows kan via de ADS (NTFS Alternative DataStream) zien of een bestand gedownload is of niet.

Geen opmerkingen:

Een reactie posten